diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-10-27 19:54:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-27 19:54:35 +0800 |
commit | d70af38447a759d4a935e315e18efa4dd625f655 (patch) | |
tree | d509c8b8dc66b58b67293131afcbfaa9311eb6c0 /routers/common/db.go | |
parent | 7cf611d197ba5d216ea5a05bb40137773e095f74 (diff) | |
download | gitea-d70af38447a759d4a935e315e18efa4dd625f655.tar.gz gitea-d70af38447a759d4a935e315e18efa4dd625f655.zip |
Refactor the DB migration system slightly (#32344)
Introduce "idNumber" for each migration, and clarify the difference
between the migration ID number and database version.
Diffstat (limited to 'routers/common/db.go')
-rw-r--r-- | routers/common/db.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/common/db.go b/routers/common/db.go index a67c9582fa..61b331760c 100644 --- a/routers/common/db.go +++ b/routers/common/db.go @@ -51,7 +51,7 @@ func migrateWithSetting(x *xorm.Engine) error { } else if current < 0 { // execute migrations when the database isn't initialized even if AutoMigration is false return migrations.Migrate(x) - } else if expected := migrations.ExpectedVersion(); current != expected { + } else if expected := migrations.ExpectedDBVersion(); current != expected { log.Fatal(`"database.AUTO_MIGRATION" is disabled, but current database version %d is not equal to the expected version %d.`+ `You can set "database.AUTO_MIGRATION" to true or migrate manually by running "gitea [--config /path/to/app.ini] migrate"`, current, expected) } |