From 161e5502000f48a629e5949389a3600fe195d7a6 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Sat, 30 May 2020 12:54:57 -0300 Subject: [PATCH] Add missing check for #11111 backport (#11693) Co-authored-by: Guillermo Prandi --- cmd/doctor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/doctor.go b/cmd/doctor.go index 2ffdfdc5f7..fd8c98963c 100644 --- a/cmd/doctor.go +++ b/cmd/doctor.go @@ -502,6 +502,10 @@ func runDoctorScriptType(ctx *cli.Context) ([]string, error) { } func runDoctorCheckDBConsistency(ctx *cli.Context) ([]string, error) { + // make sure DB version is uptodate + if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil { + return nil, fmt.Errorf("model version on the database does not match the current Gitea version. Model consistency will not be checked until the database is upgraded") + } _, committer, err := models.TxDBContext() if err != nil { return nil, err