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),
|
||||
guillermo marked this conversation as resolved
Outdated
|
||||
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);
|
||||
guillermo marked this conversation as resolved
Outdated
jgallego
commented
aprofitar per a posar el camp com a unsigned, ja que hi ha negatius, els valors actuals posarlos a uno, els mes recients son de agost. aprofitar per a posar el camp com a unsigned, ja que hi ha negatius, els valors actuals posarlos a uno, els mes recients son de agost.
|
||||
|
||||
-- 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
si baix fas açò
ALTER TABLE vn.buy MODIFY COLUMN packing int(11) NOT NULL CHECK(packing > 0);
ja no fa falta tocar esta linea perque no hi ha forma de que hi haja registres incorrectes.