Enable foreign keys in SQLite

This commit is contained in:
Tulir Asokan committed 2019-07-18 00:17:25 +03:00
1 parent 92958343dd
commit 921c1209ea
1 file changed
+4
+4
View File
@@ -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"),