Skip to content

Commit 5e0a378

Browse files
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 <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent c3893a8 commit 5e0a378

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/setting/database.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ func InitDBConfig() {
6262
sec := Cfg.Section("database")
6363
Database.Type = sec.Key("DB_TYPE").String()
6464
defaultCharset := "utf8"
65+
Database.UseMySQL = false
66+
Database.UseSQLite3 = false
67+
Database.UsePostgreSQL = false
68+
Database.UseMSSQL = false
69+
6570
switch Database.Type {
6671
case "sqlite3":
6772
Database.UseSQLite3 = true

0 commit comments

Comments
 (0)