From 148c5776337af39b1a1b1303c48cfea9d9d42528 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 13 Aug 2024 11:47:21 +0200 Subject: [PATCH] feat: refs #7860 Added new tables --- .../11186-blueHydrangea/00-firstScript.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 db/versions/11186-blueHydrangea/00-firstScript.sql diff --git a/db/versions/11186-blueHydrangea/00-firstScript.sql b/db/versions/11186-blueHydrangea/00-firstScript.sql new file mode 100644 index 000000000..6e235d913 --- /dev/null +++ b/db/versions/11186-blueHydrangea/00-firstScript.sql @@ -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);