Worker: enable SQLite foreign keys
They're not used now, but enabling them is good default behaviour anyway.
This commit is contained in:
parent
de5d12362d
commit
2a4c9b2c13
@ -77,6 +77,10 @@ func (ub *UpstreamBufferDB) OpenDB(dbCtx context.Context, databaseFilename strin
|
|||||||
return fmt.Errorf("accessing %s: %w", databaseFilename, err)
|
return fmt.Errorf("accessing %s: %w", databaseFilename, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := db.ExecContext(dbCtx, "PRAGMA foreign_keys = 1"); err != nil {
|
||||||
|
return fmt.Errorf("enabling foreign keys: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
ub.db = db
|
ub.db = db
|
||||||
|
|
||||||
if err := ub.prepareDatabase(dbCtx); err != nil {
|
if err := ub.prepareDatabase(dbCtx); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user