diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-08-24 17:24:45 +0800 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-08-24 11:24:45 +0200 |
commit | f83db078f0603c775cd1b1bb016f996b65a04835 (patch) | |
tree | 9895f852c768d43b384ba36259b44d9506b04093 /models/convert.go | |
parent | 26af3401c36e6316b81b92bf6a776bf2442d251c (diff) | |
download | gitea-f83db078f0603c775cd1b1bb016f996b65a04835.tar.gz gitea-f83db078f0603c775cd1b1bb016f996b65a04835.zip |
Move database settings from models to setting (#7806)
* move database settings from models to setting
* update docs
* fix checkout pr
* fix tests
* fix lint
* remove unsupported tidb options
* correct wrong variable name
* remove tidb totally
Diffstat (limited to 'models/convert.go')
-rw-r--r-- | models/convert.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/models/convert.go b/models/convert.go index c34be973c6..025f88b503 100644 --- a/models/convert.go +++ b/models/convert.go @@ -4,11 +4,15 @@ package models -import "fmt" +import ( + "fmt" + + "code.gitea.io/gitea/modules/setting" +) // ConvertUtf8ToUtf8mb4 converts database and tables from utf8 to utf8mb4 if it's mysql func ConvertUtf8ToUtf8mb4() error { - _, err := x.Exec(fmt.Sprintf("ALTER DATABASE `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci", DbCfg.Name)) + _, err := x.Exec(fmt.Sprintf("ALTER DATABASE `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci", setting.Database.Name)) if err != nil { return err } |