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
|
||||
}
|
||||
|
||||
if dbType == "sqlite3" {
|
||||
_, _ = conn.Exec("PRAGMA foreign_keys = ON")
|
||||
}
|
||||
|
||||
db := &Database{
|
||||
DB: conn,
|
||||
log: log.Sub("Database"),
|
||||
|
|
Loading…
Reference in a new issue