1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-22 17:18:33 +00:00

[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)
This commit is contained in:
Earl Warren 2023-08-09 00:06:25 +02:00
parent 7a1c5c0f32
commit 353913a26d
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