1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: limit sqlite connection pool to one

This commit is contained in:
Ferdinand Mütsch
2021-12-14 02:17:59 +01:00
parent c5db2c235f
commit 28a3418ad5
3 changed files with 10 additions and 2 deletions

View File

@@ -118,7 +118,7 @@ func main() {
// Connect to database
var err error
db, err = gorm.Open(config.Db.GetDialector(), &gorm.Config{Logger: gormLogger})
if config.Db.Dialect == "sqlite3" {
if config.Db.IsSQLite() {
db.Exec("PRAGMA foreign_keys = ON;")
if !utils.IsCleanDB(db) && !utils.HasConstraints(db) {
db.DisableForeignKeyConstraintWhenMigrating = true