mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-11-15 22:42:35 +01:00
Enable foreign keys in SQLite
This commit is contained in:
parent
92958343dd
commit
921c1209ea
1 changed files with 4 additions and 0 deletions
|
@ -43,6 +43,10 @@ func New(dbType string, uri string) (*Database, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if dbType == "sqlite3" {
|
||||||
|
_, _ = conn.Exec("PRAGMA foreign_keys = ON")
|
||||||
|
}
|
||||||
|
|
||||||
db := &Database{
|
db := &Database{
|
||||||
DB: conn,
|
DB: conn,
|
||||||
log: log.Sub("Database"),
|
log: log.Sub("Database"),
|
||||||
|
|
Loading…
Reference in a new issue