Replace existing rows in update functions

This commit is contained in:
Elias Projahn 2020-03-21 15:08:50 +01:00
parent 319818a276
commit 84cdd51c52

View file

@ -38,11 +38,11 @@ class Database extends _$Database {
} }
Future<void> updatePerson(Person person) async { Future<void> updatePerson(Person person) async {
await into(persons).insert(person); await into(persons).insert(person, orReplace: true);
} }
Future<void> updateInstrument(Instrument instrument) async { Future<void> updateInstrument(Instrument instrument) async {
await into(instruments).insert(instrument); await into(instruments).insert(instrument, orReplace: true);
} }
Future<void> updateWork(WorkModel model, List<WorkModel> parts) async { Future<void> updateWork(WorkModel model, List<WorkModel> parts) async {