Fix wrong warn messages in migration steps (#25475) (#25487)

This commit is contained in:
Giteabot authored and GitHub committed 2023-06-24 17:51:26 +08:00
1 parent 050c38ca19
commit 2cd9d6b3f9
3 files changed
+7 -4

No files matched your search

+4 -1
View File
@@ -123,7 +123,10 @@ func newXORMEngine() (*xorm.Engine, error) {
// SyncAllTables sync the schemas of all tables, is required by unit test code
func SyncAllTables() error {
return x.StoreEngine("InnoDB").Sync2(tables...)
_, err := x.StoreEngine("InnoDB").SyncWithOptions(xorm.SyncOptions{
WarnIfDatabaseColumnMissed: true,
}, tables...)
return err
}
// InitEngine initializes the xorm.Engine and sets it as db.DefaultContext