1
0
Fork 0
forked from forgejo/forgejo

[UPGRADE] add sanity checks for [storage*]

Refs: https://forgejo.org/2023-08-release-v1-20-3-0/
(cherry picked from commit a266dd0ce3)
(cherry picked from commit b9eb5eccd8)
(cherry picked from commit 7fc2028ede)
(cherry picked from commit 0c988e6120)
This commit is contained in:
Earl Warren 2023-08-09 00:06:25 +02:00
parent 49737cf009
commit 7ba05e8c2b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
4 changed files with 212 additions and 2 deletions

View file

@ -14,6 +14,8 @@ func init() {
db.RegisterModel(new(ForgejoSemVer))
}
var DefaultVersionString = "1.0.0"
type ForgejoSemVer struct {
Version string
}
@ -23,7 +25,8 @@ func GetVersion(ctx context.Context) (*version.Version, error) {
}
func GetVersionWithEngine(e db.Engine) (*version.Version, error) {
versionString := "v1.0.0"
versionString := DefaultVersionString
exists, err := e.IsTableExist("forgejo_sem_ver")
if err != nil {
return nil, err