diff --git a/database/build.yaml b/database/build.yaml index 11e0038..5c3643e 100644 --- a/database/build.yaml +++ b/database/build.yaml @@ -3,4 +3,5 @@ targets: builders: moor_generator: options: - generate_connect_constructor: true \ No newline at end of file + generate_connect_constructor: true + use_column_name_as_json_key_when_defined_in_moor_file: false \ No newline at end of file diff --git a/database/lib/src/database.dart b/database/lib/src/database.dart index cfc9099..1d5d5e4 100644 --- a/database/lib/src/database.dart +++ b/database/lib/src/database.dart @@ -51,7 +51,10 @@ class Database extends _$Database { /// Add [person] or replace an existing person with the same ID. Future updatePerson(Person person) async { - await into(persons).insert(person, orReplace: true); + await into(persons).insert( + person, + mode: InsertMode.insertOrReplace, + ); } /// Delete the person by [id]. @@ -79,7 +82,10 @@ class Database extends _$Database { /// Add [instrument] or replace an existing one with the same ID. Future updateInstrument(Instrument instrument) async { - await into(instruments).insert(instrument, orReplace: true); + await into(instruments).insert( + instrument, + mode: InsertMode.insertOrReplace, + ); } /// Delete the instrument by [id]. @@ -214,7 +220,10 @@ class Database extends _$Database { /// Add [ensemble] or replace an existing one with the same ID. Future updateEnsemble(Ensemble ensemble) async { - await into(ensembles).insert(ensemble, orReplace: true); + await into(ensembles).insert( + ensemble, + mode: InsertMode.insertOrReplace, + ); } /// Delete the ensemble by [id].