This commit is contained in:
parent
f421ae5ec6
commit
148c577633
|
@ -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);
|
Loading…
Reference in New Issue