mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 02:37:25 +01:00
database: Adapt to moor 3.0.0
This commit is contained in:
parent
96f80b3575
commit
437e6a3c2c
2 changed files with 14 additions and 4 deletions
|
|
@ -3,4 +3,5 @@ targets:
|
|||
builders:
|
||||
moor_generator:
|
||||
options:
|
||||
generate_connect_constructor: true
|
||||
generate_connect_constructor: true
|
||||
use_column_name_as_json_key_when_defined_in_moor_file: false
|
||||
|
|
@ -51,7 +51,10 @@ class Database extends _$Database {
|
|||
|
||||
/// Add [person] or replace an existing person with the same ID.
|
||||
Future<void> 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<void> 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<void> updateEnsemble(Ensemble ensemble) async {
|
||||
await into(ensembles).insert(ensemble, orReplace: true);
|
||||
await into(ensembles).insert(
|
||||
ensemble,
|
||||
mode: InsertMode.insertOrReplace,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete the ensemble by [id].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue