refactor(packing): refs #6875 add restriction on vn.buy.packing field not null and > 0
gitea/salix/pipeline/pr-dev Build queued... Details

This commit is contained in:
Pablo Natek 2024-02-19 09:55:54 +01:00
parent d7e51e01a2
commit 2e01b6ee0a
2 changed files with 13 additions and 1 deletions

View File

@ -182,7 +182,7 @@ proc: BEGIN
LEFT JOIN producer p ON p.id = i.producerFk
SET inv.buyingValue = b.buyingValue,
inv.freightValue = b.freightValue,
inv.packing = b.packing,
inv.packing = IFNULL(GREATEST(b.packing, 1), 1),
inv.`grouping`= b.`grouping`,
inv.groupingMode = b.groupingMode,
inv.comissionValue = b.comissionValue,

View File

@ -0,0 +1,12 @@
-- Place your SQL code here
UPDATE vn.buy
SET packing = 1
WHERE packing IS NULL
OR NOT packing
ALTER TABLE vn.buy MODIFY COLUMN packing int(11) NOT NULL CHECK(packing > 0);
-- antes tenia '0=sin obligar 1=groping 2=packing'
ALTER TABLE vn.buy MODIFY COLUMN groupingMode tinyint(4) DEFAULT 0 NOT NULL COMMENT '0=sin obligar 1=grouping 2=packing';