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:
2
main.go
2
main.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user