aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/main/resources
diff options
context:
space:
mode:
authorBenjamin, Max <max.benjamin@att.com>2020-03-24 17:54:54 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-03-24 17:54:54 -0400
commit4a6a6d301aa73dd6e4ac0f6020f63d19f7d3635d (patch)
tree0dc0b9b1d1bd4f7e4956c8ca44b629e90fcba6cd /adapters/mso-catalog-db-adapter/src/main/resources
parent3b6caf9cc8e1341ea000cb55ae277f622c816dda (diff)
split modification to flyscript into separate file
split modification to flyscript into separate file Issue-ID: SO-2764 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Id6506ee9fd0411d3ff89e7b4fe2af0af0dd39524
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main/resources')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5.1__AddServiceArtifact.sql17
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5__AddServiceArtifact.sql14
2 files changed, 27 insertions, 4 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5.1__AddServiceArtifact.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5.1__AddServiceArtifact.sql
new file mode 100644
index 0000000000..60a9482707
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5.1__AddServiceArtifact.sql
@@ -0,0 +1,17 @@
+use catalogdb;
+
+
+ALTER TABLE `service_info`
+ ADD COLUMN IF NOT EXISTS SERVICE_MODEL_UUID varchar (200)
+ NOT NULL;
+
+
+ALTER TABLE `service_artifact` DROP FOREIGN KEY `fk_service_artifact_service_info1`;
+
+ALTER TABLE `service_info`
+ ADD CONSTRAINT `fk_service_info_service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+ALTER TABLE `service_artifact`
+ ADD CONSTRAINT `fk_service_artifact_service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+DROP TABLE IF EXISTS `service_to_service_info`;
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5__AddServiceArtifact.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5__AddServiceArtifact.sql
index 6ef8446a9f..d32c4666c5 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5__AddServiceArtifact.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V7.5__AddServiceArtifact.sql
@@ -4,9 +4,7 @@ CREATE TABLE IF NOT EXISTS `service_info` (
`ID` int (11) AUTO_INCREMENT,
`SERVICE_INPUT` varchar (5000),
`SERVICE_PROPERTIES` varchar (5000),
- `SERVICE_MODEL_UUID` varchar (200) NOT NULL,
- PRIMARY KEY (`ID`),
- CONSTRAINT `fk_service_info_service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
+ PRIMARY KEY (`ID`)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `service_artifact`(
@@ -20,5 +18,13 @@ CREATE TABLE IF NOT EXISTS `service_artifact`(
`CREATION_TIMESTAMP` DATETIME DEFAULT CURRENT_TIMESTAMP,
`SERVICE_MODEL_UUID` varchar (200) NOT NULL,
PRIMARY KEY (`ARTIFACT_UUID`),
- CONSTRAINT `fk_service_artifact_service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `fk_service_artifact_service_info1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `service_to_service_info` (
+ `SERVICE_MODEL_UUID` varchar (200) NOT NULL,
+ `SERVICE_INFO_ID` INT (11) NOT NULL,
+ PRIMARY KEY (`SERVICE_MODEL_UUID`,`SERVICE_INFO_ID`),
+ CONSTRAINT `fk_service_to_service_info__service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_service_to_service_info__service_info1` FOREIGN KEY (`SERVICE_INFO_ID`) REFERENCES `service_info` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
+) \ No newline at end of file