feat: Restrict sqlbot version upgrades (#10214)

This commit is contained in:
CityFun 2025-09-01 14:26:48 +08:00 committed by GitHub
parent ff2dc05e7f
commit 0a6e1c275b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1881,10 +1881,6 @@ func ignoreUpdate(installed model.AppInstall) bool {
if installed.App.Type == "php" || installed.Status == constant.StatusInstalling {
return true
}
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
if len(ignores) > 0 {
return true
}
if installed.App.Key == constant.AppMysql {
majorVersion := getMajorVersion(installed.Version)
appDetails, _ := appDetailRepo.GetBy(appDetailRepo.WithAppId(installed.App.ID))
@ -1895,6 +1891,15 @@ func ignoreUpdate(installed model.AppInstall) bool {
}
return true
}
if installed.App.Key == "sqlbot" {
if common.CompareVersion("1.1.0", installed.Version) {
return true
}
}
ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all"))
if len(ignores) > 0 {
return true
}
return false
}