refactor: refs #6875 Add restriction on vn.buy.packing field not null and > 0 #2047
|
@ -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,
|
||||
|
|
|
@ -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';
|
||||
|
Loading…
Reference in New Issue