💄 Player optimization

This commit is contained in:
2024-09-02 20:42:33 +08:00
parent a5f39321eb
commit ddeda2ce23
6 changed files with 86 additions and 8 deletions

View File

@ -55,7 +55,21 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
@override
int get schemaVersion => 1;
int get schemaVersion => 2;
@override
MigrationStrategy get migration {
return MigrationStrategy(
onCreate: (Migrator m) async {
await m.createAll();
},
onUpgrade: (Migrator m, int from, int to) async {
if (from < 2) {
await m.addColumn(preferencesTable, preferencesTable.playerWakelock);
}
},
);
}
}
LazyDatabase _openConnection() {