From 0d43a2a069a058f5922cef7248d7a97fcb800179 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 3 Dec 2020 10:13:19 +0000 Subject: [PATCH] When reinitialising DBConfig reset the database use flags (#13796) (#13811) Backport #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 Co-authored-by: techknowlogick Co-authored-by: techknowlogick --- modules/setting/database.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/setting/database.go b/modules/setting/database.go index 7d082d13795c..3d13ee10c846 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