diff options
Diffstat (limited to 'models/migrations/v174.go')
-rw-r--r-- | models/migrations/v174.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/models/migrations/v174.go b/models/migrations/v174.go index ce337df2b3..5915d3626b 100644 --- a/models/migrations/v174.go +++ b/models/migrations/v174.go @@ -5,6 +5,8 @@ package migrations import ( + "fmt" + "xorm.io/xorm" ) @@ -19,5 +21,15 @@ func addRepoTransfer(x *xorm.Engine) error { UpdatedUnix int64 `xorm:"INDEX NOT NULL updated"` } - return x.Sync(new(RepoTransfer)) + sess := x.NewSession() + defer sess.Close() + if err := sess.Begin(); err != nil { + return err + } + + if err := sess.Sync2(new(RepoTransfer)); err != nil { + return fmt.Errorf("Sync2: %v", err) + } + + return sess.Commit() } |