mirror of
https://github.com/aykhans/slash-e.git
synced 2025-09-05 08:53:33 +00:00
fix: add sqlite foreign key flag
This commit is contained in:
@@ -43,7 +43,7 @@ func (db *DB) Open(ctx context.Context) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Connect to the database.
|
// Connect to the database.
|
||||||
sqlDB, err := sql.Open("sqlite3", db.profile.DSN)
|
sqlDB, err := sql.Open("sqlite3", db.profile.DSN+"?_foreign_keys=1")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to open db with dsn: %s, err: %w", db.profile.DSN, err)
|
return fmt.Errorf("failed to open db with dsn: %s, err: %w", db.profile.DSN, err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user