-- liquibase formatted sql
-- changeset cyril:suggested pick lot

CREATE TABLE `suggested_pick_lot`
(
    `id`             INT          NOT NULL AUTO_INCREMENT,
    `created`        DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy`      VARCHAR(30)  NULL     DEFAULT NULL,
    `version`        INT          NOT NULL DEFAULT '0',
    `modified`       DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `modifiedBy`     VARCHAR(30)  NULL     DEFAULT NULL,
    `deleted`        TINYINT(1)   NOT NULL DEFAULT '0',
    `type`           VARCHAR(100) NOT NULL,
    `stockOutLineId` INT          NULL,
    `suggestedLotId` INT          NOT NULL,
    `suggestedLocId` INT          NOT NULL,
    CONSTRAINT pk_suggested_pick_lot PRIMARY KEY (id),
    CONSTRAINT `FK_SUGGESTED_PICK_LOT_ON_STOCKOUTLINEID` FOREIGN KEY (`stockOutLineId`) REFERENCES `stock_out_line` (`id`),
    CONSTRAINT `FK_SUGGESTED_PICK_LOT_ON_SUGGESTEDLOTID` FOREIGN KEY (`suggestedLotId`) REFERENCES `inventory_lot` (`id`),
    CONSTRAINT `FK_SUGGESTED_PICK_LOT_ON_SUGGESTEDLOCID` FOREIGN KEY (`suggestedLocId`) REFERENCES `warehouse` (`id`)
);