Skip to content

Commit

Permalink
When reinitialising DBConfig reset the database use flags (go-gitea#1…
Browse files Browse the repository at this point in the history
…3796)

Backport go-gitea#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 go-gitea#13788
Fix go-gitea#5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
  • Loading branch information
zeripath and techknowlogick committed Dec 3, 2020
1 parent 8396b79 commit 46c4251
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/setting/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46c4251

Please sign in to comment.