mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 03:52:36 +02:00
Refactor the DB migration system slightly (#32344)
Introduce "idNumber" for each migration, and clarify the difference between the migration ID number and database version.
This commit is contained in:
1 parent
7cf611d197
commit
d70af38447
4 files changed
+342
-531
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user