aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/database.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-12-03 00:39:48 +0000
committerGitHub <noreply@github.com>2020-12-02 19:39:48 -0500
commit5e0a3784eafe1548bc3f05ba202721d3a597793b (patch)
tree12ef3950828a9f87c53e1014cc85a37c13736e22 /modules/setting/database.go
parentc3893a8bd1dfe2224b565c5116eebbd740e9475b (diff)
downloadgitea-5e0a3784eafe1548bc3f05ba202721d3a597793b.tar.gz
gitea-5e0a3784eafe1548bc3f05ba202721d3a597793b.zip
When reinitialising DBConfig reset the database use flags (#13796)
One perennial issue is users running the install page, changing the database dialect and then suffering with issues This PR simply resets all of the database.Use flags on initDBConfig. This should prevent this issue from occuring. Fix #13788 Fix #5480 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/setting/database.go')
-rw-r--r--modules/setting/database.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go
index 7d082d1379..3d13ee10c8 100644
--- a/modules/setting/database.go
+++ b/modules/setting/database.go
@@ -62,6 +62,11 @@ func InitDBConfig() {
sec := Cfg.Section("database")
Database.Type = sec.Key("DB_TYPE").String()
defaultCharset := "utf8"
+ Database.UseMySQL = false
+ Database.UseSQLite3 = false
+ Database.UsePostgreSQL = false
+ Database.UseMSSQL = false
+
switch Database.Type {
case "sqlite3":
Database.UseSQLite3 = true