diff options
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql | 175 | ||||
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10.1__AlterTblActivitySpecToUserParameters.sql | 3 | ||||
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql (renamed from adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__WorkFlowDesignerTables.sql) | 0 | ||||
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__Use_ID_Configuration_Customization.sql | 75 |
4 files changed, 244 insertions, 9 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql index c74ce6940c..054fb1af57 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql @@ -2,26 +2,183 @@ use catalogdb; DELETE FROM activity_spec_to_activity_spec_parameters; DELETE FROM activity_spec_to_activity_spec_categories; +DELETE FROM activity_spec_to_user_parameters; DELETE FROM activity_spec; DELETE FROM activity_spec_categories; DELETE FROM activity_spec_parameters; +DELETE FROM user_parameters; INSERT INTO activity_spec (NAME, DESCRIPTION, VERSION) -VALUES ('VNFSetInMaintFlagActivity','Activity to Set InMaint Flag in A&AI',1.0); +VALUES +('VNFSetInMaintFlagActivity','Activity to Set InMaint Flag in A&AI',1.0), +('VNFCheckPserversLockedFlagActivity','Activity Check Pservers Locked Flag VNF',1.0), +('VNFCheckInMaintFlagActivity','Activity CheckIn Maint Flag on VNF',1.0), +('VNFCheckClosedLoopDisabledFlagActivity','Activity Check Closed Loop Disabled Flag on VNF',1.0), +('VNFSetClosedLoopDisabledFlagActivity','Activity Set Closed Loop Disabled Flag on VNF',1.0), +('VNFUnsetClosedLoopDisabledFlagActivity','Activity Unset Closed Loop Disabled Flag on VNF',1.0), +('VNFLockActivity','Activity Lock on VNF',1.0), +('VNFUnlockActivity','Activity UnLock on VNF',1.0), +('VNFStopActivity','Activity Stop on VNF',1.0), +('VNFStartActivity','Activity Start on VNF',1.0), +('VNFSnapShotActivity','Activity Snap Shot on VNF',1.0), +('FlowCompleteActivity','Activity Complete on VNF',1.0), +('PauseForManualTaskActivity','Activity Pause For Manual Task on VNF',1.0), +('DistributeTrafficActivity','Activity Distribute Traffic on VNF',1.0), +('DistributeTrafficCheckActivity','Activity Distribute Traffic Check on VNF',1.0), +('VNFHealthCheckActivity','Activity Health Check on VNF',1.0), +('VNFQuiesceTrafficActivity','Activity Quiesce Traffic on VNF',1.0), +('VNFResumeTrafficActivity','Activity Resume Traffic on VNF',1.0), +('VNFUnsetInMaintFlagActivity','Activity Unset InMaint Flag on VNF',1.0), +('VNFUpgradeBackupActivity','Activity Upgrade Backup on VNF',1.0), +('VNFUpgradePostCheckActivity','Activity Upgrade Post Check on VNF',1.0), +('VNFUpgradePreCheckActivity','Activity Upgrade PreCheck on VNF',1.0), +('VNFUpgradeSoftwareActivity','Activity UpgradeS oftware on VNF',1.0), +('VnfInPlaceSoftwareUpdate','Activity InPlace Software Update on VNF',1.0); INSERT INTO activity_spec_categories (NAME) VALUES ('VNF'); -INSERT INTO activity_spec_parameters (NAME, TYPE, DIRECTION, DESCRIPTION) -VALUES('WorkflowException','WorkflowException','outputParameters','Description'); - INSERT INTO activity_spec_to_activity_spec_categories(ACTIVITY_SPEC_ID, ACTIVITY_SPEC_CATEGORIES_ID) VALUES -( -(select ID from ACTIVITY_SPEC where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), +((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0), +(select ID from activity_spec_categories where NAME='VNF')), +((select ID from activity_spec where NAME='VnfInPlaceSoftwareUpdate' and VERSION=1.0), (select ID from activity_spec_categories where NAME='VNF')); +INSERT INTO activity_spec_parameters (NAME, TYPE, DIRECTION, DESCRIPTION) +VALUES('WorkflowException','WorkflowException','output','Description'); + INSERT INTO activity_spec_to_activity_spec_parameters( ACTIVITY_SPEC_ID, ACTIVITY_SPEC_PARAMETERS_ID) -VALUES( -(select ID from ACTIVITY_SPEC where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), -(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='outputParameters'));
\ No newline at end of file +VALUES +((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')), +((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0), +(select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')); + +INSERT INTO `user_parameters`(`NAME`,`PAYLOAD_LOCATION`,`LABEL`,`TYPE`,`DESCRIPTION`,`IS_REQUIRED`,`MAX_LENGTH`,`ALLOWABLE_CHARS`) +VALUES +('cloudOwner','cloudConfiguration','Cloud Owner','text','',1,7,''), +('operations_timeout','userParams','Operations Timeout','text','',1,50,''), +('existing_software_version','userParams','Existing Software Version','text','',1,50,''), +('tenantId','cloudConfiguration','Tenant/Project ID','text','',1,36,''), +('new_software_version','userParams','New Software Version','text','',1,50,''), +('lcpCloudRegionId','cloudConfiguration','Cloud Region ID','text','',1,7,''); + +INSERT INTO `activity_spec_to_user_parameters`(`ACTIVITY_SPEC_ID`,`USER_PARAMETERS_ID`) +VALUES +((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='lcpCloudRegionId')), +((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='tenantId')), +((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='lcpCloudRegionId')), +((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='tenantId')), +((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='lcpCloudRegionId')), +((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='tenantId')), +((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='operations_timeout')), +((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='existing_software_version')), +((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='new_software_version')), +((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='existing_software_version')), +((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='new_software_version')), +((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='existing_software_version')), +((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='new_software_version')), +((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='existing_software_version')), +((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0), +(select ID from user_parameters where NAME='new_software_version'));
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10.1__AlterTblActivitySpecToUserParameters.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10.1__AlterTblActivitySpecToUserParameters.sql new file mode 100644 index 0000000000..d8bfa64033 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.10.1__AlterTblActivitySpecToUserParameters.sql @@ -0,0 +1,3 @@ +use catalogdb; + +ALTER TABLE activity_spec_to_user_parameters modify id INT(11) not null auto_increment;
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__WorkFlowDesignerTables.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql index e44a6b97ba..e44a6b97ba 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__WorkFlowDesignerTables.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7.1__WorkFlowDesignerTables.sql diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__Use_ID_Configuration_Customization.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__Use_ID_Configuration_Customization.sql new file mode 100644 index 0000000000..b39331234d --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.7__Use_ID_Configuration_Customization.sql @@ -0,0 +1,75 @@ +USE catalogdb; + +/* Drop existing foreign key */ +ALTER TABLE `catalogdb`.`configuration_customization` +DROP FOREIGN KEY IF EXISTS `fk_configuration_customization__configuration_customization1`; + +ALTER TABLE `catalogdb`.`configuration_customization` +DROP FOREIGN KEY IF EXISTS `fk_configuration_resource_customization__configuration_resour1`; +/* Drop existing index */ +ALTER TABLE `catalogdb`.`configuration_customization` +DROP INDEX IF EXISTS `fk_configuration_customization__configuration_customization_idx` ; + +/* Create a new table */ +CREATE TABLE `tmp_configuration_customization` ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL, + `MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL, + `CONFIGURATION_TYPE` VARCHAR(200) DEFAULT NULL, + `CONFIGURATION_ROLE` VARCHAR(200) DEFAULT NULL, + `CONFIGURATION_FUNCTION` VARCHAR(200) DEFAULT NULL, + `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `CONFIGURATION_MODEL_UUID` VARCHAR(200) NOT NULL, + `SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) DEFAULT NULL, + `CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_ID` int(11) DEFAULT NULL, + `SERVICE_MODEL_UUID` VARCHAR(200) NOT NULL, + PRIMARY KEY (`ID`) , + KEY `fk_configuration_customization__configuration_idx` (`CONFIGURATION_MODEL_UUID`), + KEY `fk_configuration_customization__service_idx` (`SERVICE_MODEL_UUID`), + UNIQUE KEY `uk_configuration_customization` (`MODEL_CUSTOMIZATION_UUID` ASC, `SERVICE_MODEL_UUID` ASC), + CONSTRAINT `fk_configuration_customization__configuration1` FOREIGN KEY (`CONFIGURATION_MODEL_UUID`) + REFERENCES `configuration` (`MODEL_UUID`) + ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_configuration_customization__service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) + REFERENCES `service` (`MODEL_UUID`) + ON DELETE CASCADE ON UPDATE CASCADE + +) ENGINE=INNODB DEFAULT CHARSET=LATIN1; + +/* Migrate the existing data */ +INSERT INTO tmp_configuration_customization +(`model_customization_uuid` , + `model_instance_name`, + `configuration_type` , + `configuration_role` , + `configuration_function` , + `creation_timestamp` , + `configuration_model_uuid` , + `service_proxy_customization_model_customization_uuid` , + `service_model_uuid`) +SELECT `config`.`model_customization_uuid`, + `config`.`model_instance_name`, + `config`.`configuration_type`, + `config`.`configuration_role`, + `config`.`configuration_function`, + `config`.`creation_timestamp`, + `config`.`configuration_model_uuid`, + `config`.`service_proxy_customization_model_customization_uuid`, + `svc`.`model_uuid` service_model_uuid FROM + configuration_customization config, + service svc, + configuration_customization_to_service config_svc +WHERE + config_svc.service_model_uuid = svc.model_uuid + AND config_svc.resource_model_customization_uuid = config.model_customization_uuid; + +/* Drop the old tables */ + +DROP TABLE `catalogdb`.`configuration_customization`; + +DROP TABLE `catalogdb`.`configuration_customization_to_service`; + +/* Rename the table */ +RENAME TABLE tmp_configuration_customization TO configuration_customization; + +
\ No newline at end of file |