summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-12-03 10:13:19 +0000
committerGitHub <noreply@github.com>2020-12-03 11:13:19 +0100
commit0d43a2a069a058f5922cef7248d7a97fcb800179 (patch)
tree74d648935c5492bbbe3268f4b0736b433f4afd20 /modules
parent8396b792f86ec37311e490c97f7a54ed596bce37 (diff)
downloadgitea-0d43a2a069a058f5922cef7248d7a97fcb800179.tar.gz
gitea-0d43a2a069a058f5922cef7248d7a97fcb800179.zip
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 <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-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