Skip to content

Commit

Permalink
fix(database): sqlite disable foreign key check (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviglundgren committed Apr 10, 2022
1 parent 1a4f3cf commit d3aabff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/database/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (db *DB) openSQLite() error {
// Enable foreign key checks. For historical reasons, SQLite does not check
// foreign key constraints by default. There's some overhead on inserts to
// verify foreign key integrity, but it's definitely worth it.
if _, err = db.handler.Exec(`PRAGMA foreign_keys = ON;`); err != nil {
return fmt.Errorf("foreign keys pragma: %w", err)
}
//if _, err = db.handler.Exec(`PRAGMA foreign_keys = ON;`); err != nil {
// return fmt.Errorf("foreign keys pragma: %w", err)
//}

// migrate db
if err = db.migrateSQLite(); err != nil {
Expand Down

0 comments on commit d3aabff

Please sign in to comment.