SET @isTriggerDisabled := TRUE;

UPDATE vn.buy 
	SET packing = 1
	WHERE packing IS NULL
		OR packing <= 0;

UPDATE vn.itemShelving 
	SET packing = 1
	WHERE packing IS NULL
		OR NOT packing;

SET @isTriggerDisabled := FALSE;

ALTER TABLE vn.buy MODIFY COLUMN packing int(11) NOT NULL CHECK(packing > 0);
ALTER TABLE vn.itemShelving MODIFY COLUMN packing int(11) NOT NULL CHECK(packing > 0);

-- Antes tenia '0=sin obligar 1=groping 2=packing' (groping → grouping)
ALTER TABLE vn.buy MODIFY COLUMN groupingMode tinyint(4) DEFAULT 0 NOT NULL COMMENT '0=sin obligar 1=grouping 2=packing';
