-- liquibase formatted sql
-- changeset KelvinY:add_stockTransferId_to_stock_lines

ALTER TABLE `stock_in_line`
ADD COLUMN `stockTransferId` INT NULL;

ALTER TABLE `stock_out_line`
ADD COLUMN `stockTransferId` INT NULL;

ALTER TABLE `stock_in_line`
ADD CONSTRAINT `fk_stock_in_line_stock_transfer_record`
FOREIGN KEY (`stockTransferId`) REFERENCES `stock_transfer_record`(`id`);

ALTER TABLE `stock_out_line`
ADD CONSTRAINT `fk_stock_out_line_stock_transfer_record`
FOREIGN KEY (`stockTransferId`) REFERENCES `stock_transfer_record`(`id`);