summaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-24 05:51:26 -0400
committerGitHub <noreply@github.com>2023-06-24 17:51:26 +0800
commit2cd9d6b3f94d443860202693f51a2c009f7c768e (patch)
tree00be5df98ee15b61e6daa3d68419d920afc7b12f /models/db
parent050c38ca19cce06040741321e7871121981c76f4 (diff)
downloadgitea-2cd9d6b3f94d443860202693f51a2c009f7c768e.tar.gz
gitea-2cd9d6b3f94d443860202693f51a2c009f7c768e.zip
Fix wrong warn messages in migration steps (#25475) (#25487)
Diffstat (limited to 'models/db')
-rwxr-xr-xmodels/db/engine.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/db/engine.go b/models/db/engine.go
index 56dd209fd7..3eb16f8042 100755
--- a/models/db/engine.go
+++ b/models/db/engine.go
@@ -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