-- liquibase formatted sql
-- changeset cyril:update_job_order_bom_material

ALTER TABLE `job_order_bom_material`
    DROP FOREIGN KEY `FK_JOBM_TO_SUGGESTED_PICK_LOT_ON_SUGGESTED_PICK_LOT_ID`;
ALTER TABLE `job_order_bom_material`
    CHANGE COLUMN `suggestedPickLotId` `stockOutLineId` INT NULL DEFAULT NULL ,
    DROP INDEX `FK_JOBM_TO_SUGGESTED_PICK_LOT_ON_SUGGESTED_PICK_LOT_ID` ,
    ADD INDEX `FK_JOBM_TO_STOCK_OUT_LINE_ID` (`stockOutLineId` ASC) VISIBLE;
;
ALTER TABLE `job_order_bom_material`
    ADD CONSTRAINT `FK_JOBM_TO_STOCK_OUT_LINE_ON_STOCK_OUT_LINE_ID`
        FOREIGN KEY (`stockOutLineId`)
            REFERENCES `stock_out_line` (`id`);
