Skip to content

Commit 161e550

Browse files
authored
Add missing check for #11111 backport (#11693)
Co-authored-by: Guillermo Prandi <[email protected]>
1 parent 95af609 commit 161e550

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/doctor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ func runDoctorScriptType(ctx *cli.Context) ([]string, error) {
502502
}
503503

504504
func runDoctorCheckDBConsistency(ctx *cli.Context) ([]string, error) {
505+
// make sure DB version is uptodate
506+
if err := models.NewEngine(context.Background(), migrations.EnsureUpToDate); err != nil {
507+
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")
508+
}
505509
_, committer, err := models.TxDBContext()
506510
if err != nil {
507511
return nil, err

0 commit comments

Comments
 (0)