Restructure project to root layout
This commit is contained in:
1 parent
e0e26a34ab
commit
3ffe9bbf99
51 files changed
+16
-12
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import Dexie, { Table } from 'dexie';
|
||||
import { Area } from '../models/Area';
|
||||
import { PickItem } from '../models/PickItem';
|
||||
import { PickList } from '../models/PickList';
|
||||
import { Product } from '../models/Product';
|
||||
import { applyMigrations } from './migrations';
|
||||
import { seedDatabase } from './seed';
|
||||
|
||||
export class StockFillDB extends Dexie {
|
||||
products!: Table<Product>;
|
||||
areas!: Table<Area>;
|
||||
pickLists!: Table<PickList>;
|
||||
pickItems!: Table<PickItem>;
|
||||
|
||||
constructor() {
|
||||
super('stockfill');
|
||||
this.version(1).stores({
|
||||
products:
|
||||
'id, name, category, barcode, archived, created_at, updated_at',
|
||||
areas: 'id, name, created_at, updated_at',
|
||||
pickLists: 'id, area_id, created_at, completed_at',
|
||||
pickItems: 'id, pick_list_id, product_id, status, created_at, updated_at',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const db = new StockFillDB();
|
||||
|
||||
export const initializeDatabase = async () => {
|
||||
await applyMigrations(db);
|
||||
await seedDatabase(db);
|
||||
};
|
||||
Reference in new issue
Block a user