--liquibase formatted sql

--changeset derek:update stock in ref cols
ALTER TABLE `stock_in`
DROP COLUMN `refId`,
DROP COLUMN `refType`,
ADD COLUMN `purchaseOrderId` INT NULL,
ADD COLUMN `stockOutId` INT NULL,
ADD CONSTRAINT `FK_STOCK_IN_JOB_ORDER_ON_PURCHASEORDERID`
    FOREIGN KEY (`purchaseOrderId`) REFERENCES `purchase_order` (`id`),
ADD CONSTRAINT `FK_STOCK_IN_STOCK_OUT_ON_STOCKOUTID`
    FOREIGN KEY (`stockOutId`) REFERENCES `stock_out` (`id`);