From 6d45c37d843147e69b0a27ebe35c617d7f574b76 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 28 Nov 2023 21:41:58 +0100 Subject: [PATCH] [DB] Ensure forgejo migration up to date (squash) - Hook Forgejo's `EnsureUpToDate` to Gitea's `EnsureUpToDate`, such that the Forgejo migrations are also being checked to be up to date. - I'm not sure how I missed this and if this has caused any problems, but due to the lack of any open issue about it it seems to not be a big problem. (cherry picked from commit 6c65b6dcf6ab0d58e5c2d03a866e4e38294f72ad) --- .deadcode-out | 4 ---- models/migrations/migrations.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.deadcode-out b/.deadcode-out index 5a4aa44a0f..df9824ea1b 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -48,10 +48,6 @@ package "code.gitea.io/gitea/models/forgejo/semver" func SetVersionString func SetVersion -package "code.gitea.io/gitea/models/forgejo_migrations" - func GetCurrentDBVersion - func EnsureUpToDate - package "code.gitea.io/gitea/models/git" func RemoveDeletedBranchByID diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index e01d51d391..5b0079d2dd 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -597,7 +597,7 @@ func EnsureUpToDate(x *xorm.Engine) error { return fmt.Errorf(`Current database version %d is not equal to the expected version %d. Please run "gitea [--config /path/to/app.ini] migrate" to update the database version`, currentDB, expected) } - return nil + return forgejo_migrations.EnsureUpToDate(x) } // Migrate database to current version