summaryrefslogtreecommitdiffstats
path: root/models/migrations/v1_15
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-03-07 07:11:44 -0500
committerGitHub <noreply@github.com>2023-03-07 20:11:44 +0800
commitecae62837c85708b129952d3fa976006a4e13d0f (patch)
treea78dd69bd3651850aa76fbc52059b56043b31f09 /models/migrations/v1_15
parente8e871b44e2afa1e82055c6153cc2a857f651d77 (diff)
downloadgitea-ecae62837c85708b129952d3fa976006a4e13d0f.tar.gz
gitea-ecae62837c85708b129952d3fa976006a4e13d0f.zip
Refactor `setting.Database.UseXXX` to methods (#23354) (#23356)
Backport #23354 Replace #23350. Refactor `setting.Database.UseMySQL` to `setting.Database.Type.IsMySQL()`. To avoid mismatching between `Type` and `UseXXX`. This refactor can fix the bug mentioned in #23350, so it should be backported. Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'models/migrations/v1_15')
-rw-r--r--models/migrations/v1_15/v184.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/migrations/v1_15/v184.go b/models/migrations/v1_15/v184.go
index 48f8b62165..caf41b6048 100644
--- a/models/migrations/v1_15/v184.go
+++ b/models/migrations/v1_15/v184.go
@@ -54,11 +54,11 @@ func RenameTaskErrorsToMessage(x *xorm.Engine) error {
}
switch {
- case setting.Database.UseMySQL:
+ case setting.Database.Type.IsMySQL():
if _, err := sess.Exec("ALTER TABLE `task` CHANGE errors message text"); err != nil {
return err
}
- case setting.Database.UseMSSQL:
+ case setting.Database.Type.IsMSSQL():
if _, err := sess.Exec("sp_rename 'task.errors', 'message', 'COLUMN'"); err != nil {
return err
}