feat: refs #7860 Added new tables
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-08-13 11:47:21 +02:00
parent f421ae5ec6
commit 148c577633
1 changed files with 22 additions and 0 deletions

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);