Make it possible to mark a product as opened (closes #86)

This commit is contained in:
Bernd Bestel
2018-11-17 19:39:37 +01:00
parent 816ca6460f
commit 10ea9c44fd
12 changed files with 356 additions and 8 deletions

17
migrations/0046.sql Normal file
View File

@@ -0,0 +1,17 @@
ALTER TABLE stock
ADD opened_date DATETIME;
ALTER TABLE stock_log
ADD opened_date DATETIME;
ALTER TABLE stock
ADD open TINYINT NOT NULL DEFAULT 0 CHECK(open IN (0, 1));
UPDATE stock
SET open = 0;
ALTER TABLE products
ADD default_best_before_days_after_open INTEGER NOT NULL DEFAULT 0;
UPDATE products
SET default_best_before_days_after_open = 0;