mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-01 17:38:33 +00:00
[PORT] Refactor the DB migration system slightly (gitea#32344)
Introduce "idNumber" for each migration, and clarify the difference between the migration ID number and database version. --- Conflict resolution: trivial (cherry picked from commit d70af38447a759d4a935e315e18efa4dd625f655)
This commit is contained in:
parent
20c0a2a381
commit
498b5f9867
4 changed files with 338 additions and 524 deletions
|
@ -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 "forgejo [--config /path/to/app.ini] migrate"`, current, expected)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue