forked from forgejo/forgejo
[UPGRADE] add sanity checks for [storage*]
Refs: https://forgejo.org/2023-08-release-v1-20-3-0/ (cherry picked from commita266dd0ce3
) (cherry picked from commitb9eb5eccd8
) (cherry picked from commit7fc2028ede
) (cherry picked from commit0c988e6120
)
This commit is contained in:
parent
49737cf009
commit
7ba05e8c2b
4 changed files with 212 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue