Enable foreign key support

This commit is contained in:
Elias Projahn 2020-03-21 15:41:03 +01:00
parent 4994f6395f
commit 71d51596ae

View file

@ -29,6 +29,13 @@ class Database extends _$Database {
@override
int get schemaVersion => 1;
@override
MigrationStrategy get migration => MigrationStrategy(
beforeOpen: (details) async {
await customStatement('PRAGMA foreign_keys = ON');
}
);
// TODO: Remove this once https://github.com/simolus3/moor/issues/453 is fixed.
Selectable<Work> worksByComposer(int id) {
return customSelectQuery(