mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Cascade changes of stock quantity unit of products to recipe positions (fixes #91)
This commit is contained in:
parent
f13abf483e
commit
70c00e81d9
7
migrations/0042.sql
Normal file
7
migrations/0042.sql
Normal file
@ -0,0 +1,7 @@
|
||||
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;
|
Loading…
x
Reference in New Issue
Block a user