Initial and done prolly
This commit is contained in:
commit
6f88b9966f
175 changed files with 15445 additions and 0 deletions
15
lib/db/tables/product.dart
Normal file
15
lib/db/tables/product.dart
Normal 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)();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue