mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Start migrating the ingredient cache to a local sqlite database
This commit is contained in:
@@ -10,6 +10,7 @@ part 'ingredients_database.g.dart';
|
||||
@DataClassName('IngredientTable')
|
||||
class Ingredients extends Table {
|
||||
const Ingredients();
|
||||
|
||||
IntColumn get id => integer()();
|
||||
|
||||
TextColumn get data => text()();
|
||||
@@ -27,6 +28,14 @@ class IngredientDatabase extends _$IngredientDatabase {
|
||||
@override
|
||||
// TODO: implement schemaVersion
|
||||
int get schemaVersion => 1;
|
||||
|
||||
Future<void> deleteEverything() {
|
||||
return transaction(() async {
|
||||
for (final table in allTables) {
|
||||
await delete(table).go();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
LazyDatabase _openConnection() {
|
||||
|
||||
Reference in New Issue
Block a user