diff options
author | guillep2k | 2020-05-30 12:54:57 -0300 |
---|---|---|
committer | GitHub | 2020-05-30 12:54:57 -0300 |
commit | 161e5502000f48a629e5949389a3600fe195d7a6 (patch) | |
tree | 058c3c77efe3d831becd02d421927ff5429c6370 | |
parent | 95af6096fbd65d9b28a8a4b6ecbb2beb883183d6 (diff) |
Add missing check for #11111 backport (#11693)
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
-rw-r--r-- | cmd/doctor.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/doctor.go b/cmd/doctor.go index 2ffdfdc5f..fd8c98963 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 |