Initial and done prolly

This commit is contained in:
Andrew 2025-01-05 16:01:21 +07:00
commit 6f88b9966f
175 changed files with 15445 additions and 0 deletions

View file

@ -0,0 +1,15 @@
import 'package:drift/drift.dart';
import 'package:groceries_manager/db/tables/product_category.dart';
import 'package:groceries_manager/db/tables/storage_location.dart';
class Product extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get name => text()();
IntColumn get category => integer().references(ProductCategory, #id)();
IntColumn get storage => integer().references(StorageLocation, #id)();
RealColumn get quantity => real()();
TextColumn get unit => text()();
DateTimeColumn get purchaseDate => dateTime().nullable()();
DateTimeColumn get expiryDate => dateTime().nullable()();
TextColumn get barcode => text().withLength(max: 20)();
}