mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Remove seperate role repesentation
The role and instrument tables have been merged into one (the instrument table). There are not that many roles that aren't instruments and it is much simpler to mange this way. The role editor and role selector have been removed and the instrument related UI parts have been modified accordingly.
This commit is contained in:
parent
24f2022930
commit
99e4711cfc
8 changed files with 57 additions and 172 deletions
|
|
@ -20,7 +20,7 @@ class WorkModel {
|
|||
class PerformanceModel {
|
||||
final Person person;
|
||||
final Ensemble ensemble;
|
||||
final Role role;
|
||||
final Instrument role;
|
||||
|
||||
PerformanceModel({
|
||||
this.person,
|
||||
|
|
@ -42,10 +42,11 @@ class Database extends _$Database {
|
|||
int get schemaVersion => 1;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration =>
|
||||
MigrationStrategy(beforeOpen: (details) async {
|
||||
await customStatement('PRAGMA foreign_keys = ON');
|
||||
});
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
beforeOpen: (details) async {
|
||||
await customStatement('PRAGMA foreign_keys = ON');
|
||||
},
|
||||
);
|
||||
|
||||
Future<void> updatePerson(Person person) async {
|
||||
await into(persons).insert(person, orReplace: true);
|
||||
|
|
@ -82,10 +83,6 @@ class Database extends _$Database {
|
|||
await into(ensembles).insert(ensemble, orReplace: true);
|
||||
}
|
||||
|
||||
Future<void> updateRole(Role role) async {
|
||||
await into(roles).insert(role, orReplace: true);
|
||||
}
|
||||
|
||||
Future<void> updateRecording(
|
||||
Recording recording, List<PerformanceModel> models) async {
|
||||
await transaction(() async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue