Added custom statement for cascade deleting

This commit is contained in:
2025-11-19 00:22:13 +01:00
parent 42ce69f4d3
commit 69c95ca672
2 changed files with 52 additions and 261 deletions

View File

@@ -40,6 +40,15 @@ class AppDatabase extends _$AppDatabase {
@override
int get schemaVersion => 1;
@override
MigrationStrategy get migration {
return MigrationStrategy(
beforeOpen: (details) async {
await customStatement('PRAGMA foreign_keys = ON');
},
);
}
static QueryExecutor _openConnection() {
return driftDatabase(
name: 'gametracker_db',