aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguillep2k2020-05-30 12:54:57 -0300
committerGitHub2020-05-30 12:54:57 -0300
commit161e5502000f48a629e5949389a3600fe195d7a6 (patch)
tree058c3c77efe3d831becd02d421927ff5429c6370
parent95af6096fbd65d9b28a8a4b6ecbb2beb883183d6 (diff)
Add missing check for #11111 backport (#11693)
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
-rw-r--r--cmd/doctor.go4
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