ALTER TABLE `#__djc2_units` ADD `unit_type` ENUM('length','weight','capacity','other') NULL DEFAULT 'other' AFTER `unit`;

UPDATE `#__djc2_units` SET `unit_type` = 'weight' WHERE `unit` = 'kg';
UPDATE `#__djc2_units` SET `unit_type` = 'capacity' WHERE `unit` = 'l';
UPDATE `#__djc2_units` SET `unit_type` = 'length' WHERE `unit` = 'm';

ALTER TABLE `#__djc2_items`  
ADD `length` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `unit_id`,  
ADD `width` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `length`,  
ADD `height` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `width`,  
ADD `dimensions_unit` INT NOT NULL DEFAULT '0'  AFTER `height`,  
ADD `weight` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `dimensions_unit`,  
ADD `weight_unit` INT NOT NULL DEFAULT '0'  AFTER `weight`;

ALTER TABLE `#__djc2_items_combinations`  
ADD `length` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `stock`,  
ADD `width` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `length`,  
ADD `height` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `width`,  
ADD `dimensions_unit` INT NOT NULL DEFAULT '0'  AFTER `height`,  
ADD `weight` DECIMAL(10,4) NOT NULL DEFAULT '0.0000'  AFTER `dimensions_unit`,  
ADD `weight_unit` INT NOT NULL DEFAULT '0'  AFTER `weight`;
