-- liquibase formatted sql
-- changeset cyril:update_stock_in_line

ALTER TABLE `stock_in_line`
    DROP FOREIGN KEY `FK_STOCK_IN_LINE_PURCHASE_ORDER_LINE_ON_PURCHASEORDERLINEID`,
    DROP FOREIGN KEY `FK_STOCK_IN_LINE_TO_PURCHASE_ORDER_ON_PURCHASE_ORDER_ID`;
ALTER TABLE `stock_in_line`
    CHANGE COLUMN `purchaseOrderId` `purchaseOrderId` INT NULL ,
    CHANGE COLUMN `purchaseOrderLineId` `purchaseOrderLineId` INT NULL ;
ALTER TABLE `stock_in_line`
    ADD CONSTRAINT `FK_STOCK_IN_LINE_PURCHASE_ORDER_LINE_ON_PURCHASEORDERLINEID`
        FOREIGN KEY (`purchaseOrderLineId`)
            REFERENCES `purchase_order_line` (`id`),
    ADD CONSTRAINT `FK_STOCK_IN_LINE_TO_PURCHASE_ORDER_ON_PURCHASE_ORDER_ID`
        FOREIGN KEY (`purchaseOrderId`)
            REFERENCES `purchase_order` (`id`);
