feat: refs #7860 Added new tables #2857

Closed
guillermo wants to merge 1 commits from 7860-packagingBox into dev
1 changed files with 22 additions and 0 deletions
Showing only changes of commit 148c577633 - Show all commits

View File

@ -0,0 +1,22 @@
CREATE TABLE `vn`.`packagingBoxType` (
`code` varchar(100) NOT NULL,
`priority` int(11) unsigned NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
CREATE TABLE `vn`.`packagingBox` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`packagingFk` varchar(10) NOT NULL,
`itemPackingTypeFk` varchar(1) NOT NULL,
`typeFk` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `packagingBox_packaging_FK` (`packagingFk`),
KEY `packagingBox_itemPackingType_FK` (`itemPackingTypeFk`),
KEY `packagingBox_packagingBoxType_FK` (`typeFk`),
CONSTRAINT `packagingBox_itemPackingType_FK` FOREIGN KEY (`itemPackingTypeFk`) REFERENCES `itemPackingType` (`code`) ON UPDATE CASCADE,
CONSTRAINT `packagingBox_packagingBoxType_FK` FOREIGN KEY (`typeFk`) REFERENCES `packagingBoxType` (`code`) ON UPDATE CASCADE,
CONSTRAINT `packagingBox_packaging_FK` FOREIGN KEY (`packagingFk`) REFERENCES `packaging` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT INTO vn.packagingBoxType (code, priority)
VALUES ('narrow', 1), ('wide', 2), ('square', 3);