feat: alphabet list, change Layout etc
This commit is contained in:
@@ -30,6 +30,10 @@ class Products extends Table {
|
||||
|
||||
IntColumn get lowStockThreshold => integer()();
|
||||
|
||||
/// Products like tap water that are never counted; their stock is ignored.
|
||||
BoolColumn get infiniteStock =>
|
||||
boolean().withDefault(const Constant(false))();
|
||||
|
||||
IntColumn get priceInCents => integer()();
|
||||
|
||||
TextColumn get imagePath => text().nullable()();
|
||||
@@ -200,7 +204,7 @@ class AppDatabase extends _$AppDatabase {
|
||||
AppDatabase([QueryExecutor? executor]) : super(executor ?? _openConnection());
|
||||
|
||||
@override
|
||||
int get schemaVersion => 13;
|
||||
int get schemaVersion => 14;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@@ -295,6 +299,10 @@ class AppDatabase extends _$AppDatabase {
|
||||
await _backfillPurchaseRows();
|
||||
await _deleteOrphanedPurchaseRows();
|
||||
}
|
||||
|
||||
if (from < 14 && !await hasTableColumn('products', 'infinite_stock')) {
|
||||
await migrator.addColumn(products, products.infiniteStock);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user