-- liquibase formatted sql
-- changeset cyril:update_inventory_default

ALTER TABLE `inventory`
    DROP FOREIGN KEY `FK_INVENTORY_TO_UOM_ON_UOM_ID`;
ALTER TABLE `inventory`
    CHANGE COLUMN `onHandQty` `onHandQty` DECIMAL(14,2) NOT NULL DEFAULT '0.00' ,
    CHANGE COLUMN `price` `price` INT NULL DEFAULT 0 ,
    CHANGE COLUMN `cpu` `cpu` DECIMAL(14,2) NULL DEFAULT '0.00' ,
    CHANGE COLUMN `cpuUnit` `cpuUnit` VARCHAR(255) NULL DEFAULT 'HKD' ,
    CHANGE COLUMN `cpm` `cpm` DECIMAL(14,2) NULL DEFAULT '0.00' ,
    CHANGE COLUMN `cpmUnit` `cpmUnit` VARCHAR(255) NULL DEFAULT 'HKD' ,
    CHANGE COLUMN `uomId` `uomId` INT NULL ,
    CHANGE COLUMN `status` `status` VARCHAR(255) NOT NULL DEFAULT 'available' ;
ALTER TABLE `inventory`
    ADD CONSTRAINT `FK_INVENTORY_TO_UOM_ON_UOM_ID`
        FOREIGN KEY (`uomId`)
            REFERENCES `uom_conversion` (`id`);

