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)
(cherry picked from commit 7ba05e8c2b)
(cherry picked from commit 2ed5068abe)
(cherry picked from commit 353913a26d)
(cherry picked from commit 4e63a01a8b)
(cherry picked from commit 99f612aed3)
(cherry picked from commit b4fe189cae)
(cherry picked from commit 520295a6f5)
(cherry picked from commit e5a564044b)
(cherry picked from commit 52cc6c26fc)
(cherry picked from commit d58f04bd1d)
(cherry picked from commit 1b7213a98b)
This commit is contained in:
Earl Warren 2023-08-09 00:06:25 +02:00
parent 2ea0db1a07
commit 18fd949916
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