Prohibit automatic downgrades by checking the version of the db and warning if the version number should be lower.
Close#13107
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
@ -315,12 +316,16 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t
returnnil
returnnil
}
}
// Downgraded Gitea not supported
ifint(v-minDBVersion)>len(migrations){
ifint(v-minDBVersion)>len(migrations){
// User downgraded Gitea.
msg:=fmt.Sprintf("Downgrading Gitea from '%d' to '%d' is not supported and may result in loss of data integrity.\nIf you really know what you're doing, execute `UPDATE version SET version=%d WHERE id=1;`\n",