--liquibase formatted sql

--changeset enson:update pick_order_group

CREATE TABLE `Router` (
   `id` int NOT NULL AUTO_INCREMENT,
   `index` int NOT NULL,
   `route` varchar(50) NOT NULL,
   `area` varchar(50) NOT NULL,
   `item_code` int NOT NULL,
   `item_name` varchar(255) DEFAULT NULL,
   `uomId` int NOT NULL,
   `NoofCarton` int NOT NULL,
   `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `createdBy` varchar(30) DEFAULT NULL,
   `version` int NOT NULL DEFAULT '0',
   `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `modifiedBy` varchar(30) DEFAULT NULL,
   `deleted` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`),
   KEY `FK_Router_ON_ITEM` (`item_code`),
   KEY `FK_Router_ON_UOM` (`uomId`),
   CONSTRAINT `FK_Router_ON_ITEM` FOREIGN KEY (`item_code`) REFERENCES `items` (`id`),
   CONSTRAINT `FK_Router_ON_UOM` FOREIGN KEY (`uomId`) REFERENCES `uom_conversion` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `Truck` (
   `id` int NOT NULL AUTO_INCREMENT,
   `truckNo` varchar(50) NOT NULL,
   `truckName` varchar(100) DEFAULT NULL,
   `DepartureTime` TIME NULL DEFAULT NULL,
   `shopId` INT NULL DEFAULT NULL,
   `capacity` decimal(10,2) DEFAULT NULL,
   `status` varchar(20) DEFAULT NULL,
   `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `createdBy` varchar(30) DEFAULT NULL,
   `version` int NOT NULL DEFAULT '0',
   `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `modifiedBy` varchar(30) DEFAULT NULL,
   `deleted` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`),
   UNIQUE KEY `UK_Truck_truckNo` (`truckNo`),
   KEY `FK_Truck_ON_SHOP` (`shopId`),
   CONSTRAINT `FK_Truck_ON_SHOP` FOREIGN KEY (`shopId`) REFERENCES `shop` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;