diff options
author | Jason Song | 2023-03-07 18:51:06 +0800 |
---|---|---|
committer | GitHub | 2023-03-07 18:51:06 +0800 |
commit | c84238800bb743181582f043ece9b44fef233c95 (patch) | |
tree | 83cf618233bb1a51c4a3325f8fa7662bb136afb1 /models/migrations/v1_15/v184.go | |
parent | 84a299310d9a8f6387f18a1711485b7f33e6f6b5 (diff) |
Refactor `setting.Database.UseXXX` to methods (#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.
Diffstat (limited to 'models/migrations/v1_15/v184.go')
-rw-r--r-- | models/migrations/v1_15/v184.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/migrations/v1_15/v184.go b/models/migrations/v1_15/v184.go index 48f8b6216..caf41b604 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 } |