From ecae62837c85708b129952d3fa976006a4e13d0f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 7 Mar 2023 07:11:44 -0500 Subject: 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 --- models/migrations/v1_15/v184.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/migrations/v1_15') 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 } -- cgit v1.2.3