diff options
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 2 | ||||
-rw-r--r-- | models/migrations/v125.go | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 226368b7f3..286e809abb 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -304,6 +304,8 @@ var migrations = []Migration{ NewMigration("Add original informations for reactions", addReactionOriginals), // v124 -> v125 NewMigration("Add columns to user and repository", addUserRepoMissingColumns), + // v125 -> v126 + NewMigration("Add some columns on review for migration", addReviewMigrateInfo), } // Migrate database to current version diff --git a/models/migrations/v125.go b/models/migrations/v125.go new file mode 100644 index 0000000000..ac567f66b9 --- /dev/null +++ b/models/migrations/v125.go @@ -0,0 +1,23 @@ +// Copyright 2020 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package migrations + +import ( + "fmt" + + "xorm.io/xorm" +) + +func addReviewMigrateInfo(x *xorm.Engine) error { + type Review struct { + OriginalAuthor string + OriginalAuthorID int64 + } + + if err := x.Sync2(new(Review)); err != nil { + return fmt.Errorf("Sync2: %v", err) + } + return nil +} |