diff options
author | 2018-07-30 15:56:09 -0400 | |
---|---|---|
committer | 2018-07-31 11:09:25 -0400 | |
commit | 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch) | |
tree | 59a968f27b4b603aacc9d5e7b51fb598aeec5321 /adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql | |
parent | b6dc38501f3b746426b42d9de4cc883d894149e8 (diff) |
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql')
-rw-r--r-- | adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql new file mode 100644 index 0000000000..9992f5531a --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql @@ -0,0 +1,93 @@ +USE catalogdb; + +ALTER TABLE building_block_detail +CHANGE COLUMN building_block_name BUILDING_BLOCK_NAME VARCHAR(50) NOT NULL, +CHANGE COLUMN resource_type RESOURCE_TYPE VARCHAR(25) NOT NULL, +CHANGE COLUMN target_action TARGET_ACTION VARCHAR(25) NOT NULL; +/* +SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CHANGE ', COLUMN_NAME, ' ', UPPER(COLUMN_NAME), ';') +FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'building_block_detail' AND COLUMN_NAME <> 'id'; +*/ + +ALTER TABLE orchestration_status_state_transition_directive +CHANGE COLUMN resource_type RESOURCE_TYPE VARCHAR(25) NOT NULL, +CHANGE COLUMN orchestration_status ORCHESTRATION_STATUS VARCHAR(25) NOT NULL, +CHANGE COLUMN target_action TARGET_ACTION VARCHAR(25) NOT NULL, +CHANGE COLUMN flow_directive FLOW_DIRECTIVE VARCHAR(25) NOT NULL; + +/* +SELECT CONCAT('ALTER TABLE ', TABLE_NAME, ' CHANGE ', COLUMN_NAME, ' ', UPPER(COLUMN_NAME), ';') +FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'orchestration_status_state_transition_directive' AND COLUMN_NAME <> 'id'; +*/ + +ALTER TABLE building_block_detail +DROP INDEX building_block_name; + +ALTER TABLE building_block_detail +ADD UNIQUE KEY UK_building_block_name (BUILDING_BLOCK_NAME); + + +/* +SELECT DISTINCT FLOW_NAME FROM orchestration_flow_reference WHERE FLOW_NAME NOT IN +(SELECT building_block_name FROM building_block_detail); + */ + +UPDATE orchestration_flow_reference +SET FLOW_NAME = 'ActivateServiceInstanceBB' +WHERE FLOW_NAME = 'ActivateServiceInstance'; + +DELETE FROM orchestration_flow_reference +WHERE FLOW_NAME = 'DeactivateNetworkCollectionBB'; + +UPDATE orchestration_flow_reference +SET SEQ_NO = SEQ_NO - 1 +WHERE COMPOSITE_ACTION = 'Service-Macro-Delete' AND SEQ_NO > 8; + +UPDATE orchestration_flow_reference +SET SEQ_NO = SEQ_NO - 1 +WHERE COMPOSITE_ACTION = 'NetworkCollection-Macro-Delete' AND SEQ_NO > 4; + +UPDATE building_block_detail +SET BUILDING_BLOCK_NAME = 'UnassignVolumeGroupBB' +WHERE BUILDING_BLOCK_NAME = 'UnassignVolumeGroup'; + +UPDATE building_block_detail +SET TARGET_ACTION = 'CHANGE_MODEL' +WHERE TARGET_ACTION = 'CHANGEMODEL'; + +INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) +VALUES +('UnassignVfModuleBB', 'VF_MODULE', 'UNASSIGN'), +('AssignAndActivateVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), +('AvpnAssignServiceInstanceBB', 'CUSTOM', 'CUSTOM'), +('CreateCustomerVpnBindingBB', 'CUSTOM', 'CUSTOM'), +('SniroHoming', 'CUSTOM', 'CUSTOM'), +('DeactivateAndUnassignVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), +('DeactivateNetworkCollectionBB', 'CUSTOM', 'CUSTOM'), +('AAICheckVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('AAISetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('AAIUnsetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), +('SDNOVnfHealthCheckBB', 'CUSTOM', 'CUSTOM'), +('VNF-Macro-Replace', 'CUSTOM', 'CUSTOM'), +('HomingV2', 'CUSTOM', 'CUSTOM'); + +ALTER TABLE building_block_detail +MODIFY COLUMN BUILDING_BLOCK_NAME VARCHAR(200); + +ALTER TABLE orchestration_flow_reference +ADD CONSTRAINT fk_orchestration_flow_reference__building_block_detail +FOREIGN KEY (FLOW_NAME) REFERENCES building_block_detail(BUILDING_BLOCK_NAME) +ON DELETE CASCADE +ON UPDATE CASCADE; + +INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) +VALUES +('CUSTOM', 'ACTIVE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'CREATED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), +('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE'); |