From 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 Mon Sep 17 00:00:00 2001
From: "Benjamin, Max (mb388a)" <mb388a@us.att.com>
Date: Mon, 30 Jul 2018 15:56:09 -0400
Subject: Containerization feature of SO

Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
---
 .../db/migration/V2.7__VNFCInstanceGroup1806.sql   | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql

(limited to 'adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql')

diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql
new file mode 100644
index 0000000000..d83d6ecad9
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.7__VNFCInstanceGroup1806.sql
@@ -0,0 +1,57 @@
+use catalogdb;
+
+CREATE TABLE IF NOT EXISTS `catalogdb`.`collection_resource_instance_group_customization` (
+  `COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID` VARCHAR(200) NOT NULL,
+  `INSTANCE_GROUP_MODEL_UUID` VARCHAR(200) NOT NULL,
+  `FUNCTION` VARCHAR(200) NULL,
+  `DESCRIPTION` VARCHAR(1200) NULL,
+  `SUBINTERFACE_NETWORK_QUANTITY` INT(11) NULL,
+  `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID`, `INSTANCE_GROUP_MODEL_UUID`),
+  INDEX `fk_collection_resource_instance_group_customization__instan_idx` (`INSTANCE_GROUP_MODEL_UUID` ASC),
+  CONSTRAINT `fk_collection_resource_instance_group_customization__collecti1`
+    FOREIGN KEY (`COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID`)
+    REFERENCES `catalogdb`.`collection_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE,
+  CONSTRAINT `fk_collection_resource_instance_group_customization__instance1`
+    FOREIGN KEY (`INSTANCE_GROUP_MODEL_UUID`)
+    REFERENCES `catalogdb`.`instance_group` (`MODEL_UUID`)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE)
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
+
+CREATE TABLE IF NOT EXISTS `catalogdb`.`vnfc_instance_group_customization` (
+  `VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID` VARCHAR(200) NOT NULL,
+  `INSTANCE_GROUP_MODEL_UUID` VARCHAR(200) NOT NULL,
+  `FUNCTION` VARCHAR(200) NULL,
+  `DESCRIPTION` VARCHAR(1200) NULL,
+  `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID`, `INSTANCE_GROUP_MODEL_UUID`),
+  INDEX `fk_vnfc_instance_group_customization__instance_group1_idx` (`INSTANCE_GROUP_MODEL_UUID` ASC),
+  CONSTRAINT `fk_vnfc_instance_group_customization__vnf_resource_customizat1`
+    FOREIGN KEY (`VNF_RESOURCE_CUSTOMIZATION_MODEL_UUID`)
+    REFERENCES `catalogdb`.`vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE,
+  CONSTRAINT `fk_vnfc_instance_group_customization__instance_group1`
+    FOREIGN KEY (`INSTANCE_GROUP_MODEL_UUID`)
+    REFERENCES `catalogdb`.`instance_group` (`MODEL_UUID`)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE)
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
+
+Alter TABLE `instance_group`
+DROP COLUMN  `function`,
+DROP COLUMN  `description`,
+CHANGE `primary_type` `object_type` varchar(200) NOT NULL,
+MODIFY  `tosca_node_type` varchar(200) NULL;
+  
+Alter TABLE `collection_resource_customization`
+DROP COLUMN  `subinterface_network_quantity`,
+CHANGE `primary_type` `object_type` varchar(200) NOT NULL,
+MODIFY  role varchar(200) NULL,
+MODIFY function varchar(200)  NULL,
+MODIFY collection_resource_type varchar(200) NULL;
-- 
cgit 1.2.3-korg

