1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00: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:
wxiaoguang
2024-10-27 19:54:35 +08:00
committed by GitHub
parent 7cf611d197
commit d70af38447
4 changed files with 342 additions and 531 deletions

View File

@ -12,7 +12,7 @@ import (
)
func checkDBVersion(ctx context.Context, logger log.Logger, autofix bool) error {
logger.Info("Expected database version: %d", migrations.ExpectedVersion())
logger.Info("Expected database version: %d", migrations.ExpectedDBVersion())
if err := db.InitEngineWithMigration(ctx, migrations.EnsureUpToDate); err != nil {
if !autofix {
logger.Critical("Error: %v during ensure up to date", err)