mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed a problem with newer SQLite versions (references and fixes #133)
This commit is contained in:
parent
f6649d51bd
commit
43c9ab7734
@ -29,6 +29,15 @@ FROM recipes_pos_old;
|
|||||||
|
|
||||||
DROP TABLE recipes_pos_old;
|
DROP TABLE recipes_pos_old;
|
||||||
|
|
||||||
|
DROP TRIGGER cascade_change_qu_id_stock;
|
||||||
|
CREATE TRIGGER cascade_change_qu_id_stock AFTER UPDATE ON products
|
||||||
|
BEGIN
|
||||||
|
UPDATE recipes_pos
|
||||||
|
SET qu_id = (SELECT qu_id_stock FROM products WHERE id = NEW.id)
|
||||||
|
WHERE product_id IN (SELECT id FROM products WHERE id = NEW.id)
|
||||||
|
AND only_check_single_unit_in_stock = 0;
|
||||||
|
END;
|
||||||
|
|
||||||
DROP VIEW recipes_fulfillment;
|
DROP VIEW recipes_fulfillment;
|
||||||
CREATE VIEW recipes_fulfillment
|
CREATE VIEW recipes_fulfillment
|
||||||
AS
|
AS
|
||||||
|
12
migrations/0047.sql
Normal file
12
migrations/0047.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
DROP TRIGGER cascade_change_qu_id_stock;
|
||||||
|
CREATE TRIGGER cascade_change_qu_id_stock AFTER UPDATE ON products
|
||||||
|
BEGIN
|
||||||
|
UPDATE recipes_pos
|
||||||
|
SET qu_id = (SELECT qu_id_stock FROM products WHERE id = NEW.id)
|
||||||
|
WHERE product_id IN (SELECT id FROM products WHERE id = NEW.id)
|
||||||
|
AND only_check_single_unit_in_stock = 0;
|
||||||
|
END;
|
||||||
|
|
||||||
|
UPDATE recipes_pos
|
||||||
|
SET qu_id = (SELECT qu_id_stock FROM products WHERE id = recipes_pos.product_id)
|
||||||
|
WHERE only_check_single_unit_in_stock = 0;
|
Loading…
x
Reference in New Issue
Block a user