diff --git a/legacy/src/test/resources/db/migration/V9__adding_l_to_l.sql b/legacy/src/test/resources/db/migration/V9__adding_l_to_l.sql index d5aa8e3422..9104bb6cb5 100644 --- a/legacy/src/test/resources/db/migration/V9__adding_l_to_l.sql +++ b/legacy/src/test/resources/db/migration/V9__adding_l_to_l.sql @@ -1,4 +1,4 @@ --- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID FM type in an idempotent way +-- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID LP type in an idempotent way MERGE INTO THE.REGISTRY_COMPANY_TYPE_CODE tgt USING ( SELECT 'LP' AS REGISTRY_COMPANY_TYPE_CODE, @@ -19,7 +19,7 @@ WHEN NOT MATCHED THEN INSERT (REGISTRY_COMPANY_TYPE_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) VALUES (src.REGISTRY_COMPANY_TYPE_CODE, src.DESCRIPTION, src.EFFECTIVE_DATE, src.EXPIRY_DATE, src.UPDATE_TIMESTAMP); --- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID FM code linking with I in an idempotent way +-- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID LP code linking with L in an idempotent way MERGE INTO THE.CLIENT_TYPE_COMPANY_XREF tgt USING ( SELECT 'L' AS CLIENT_TYPE_CODE, @@ -41,7 +41,7 @@ WHEN NOT MATCHED THEN INSERT (CLIENT_TYPE_CODE, REGISTRY_COMPANY_TYPE_CODE, ADD_USERID, ADD_TIMESTAMP, UPDATE_USERID, UPDATE_TIMESTAMP) VALUES (src.CLIENT_TYPE_CODE, src.REGISTRY_COMPANY_TYPE_CODE, src.ADD_USERID, src.ADD_TIMESTAMP, src.UPDATE_USERID, src.UPDATE_TIMESTAMP); --- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID FM type in an idempotent way +-- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID LL type in an idempotent way MERGE INTO THE.REGISTRY_COMPANY_TYPE_CODE tgt USING ( SELECT 'LL' AS REGISTRY_COMPANY_TYPE_CODE, @@ -62,7 +62,7 @@ WHEN NOT MATCHED THEN INSERT (REGISTRY_COMPANY_TYPE_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) VALUES (src.REGISTRY_COMPANY_TYPE_CODE, src.DESCRIPTION, src.EFFECTIVE_DATE, src.EXPIRY_DATE, src.UPDATE_TIMESTAMP); --- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID FM code linking with I in an idempotent way +-- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID LL code linking with L in an idempotent way MERGE INTO THE.CLIENT_TYPE_COMPANY_XREF tgt USING ( SELECT 'L' AS CLIENT_TYPE_CODE, @@ -84,7 +84,7 @@ WHEN NOT MATCHED THEN INSERT (CLIENT_TYPE_CODE, REGISTRY_COMPANY_TYPE_CODE, ADD_USERID, ADD_TIMESTAMP, UPDATE_USERID, UPDATE_TIMESTAMP) VALUES (src.CLIENT_TYPE_CODE, src.REGISTRY_COMPANY_TYPE_CODE, src.ADD_USERID, src.ADD_TIMESTAMP, src.UPDATE_USERID, src.UPDATE_TIMESTAMP); --- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID FM type in an idempotent way +-- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID XP type in an idempotent way MERGE INTO THE.REGISTRY_COMPANY_TYPE_CODE tgt USING ( SELECT 'XP' AS REGISTRY_COMPANY_TYPE_CODE, @@ -105,7 +105,7 @@ WHEN NOT MATCHED THEN INSERT (REGISTRY_COMPANY_TYPE_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) VALUES (src.REGISTRY_COMPANY_TYPE_CODE, src.DESCRIPTION, src.EFFECTIVE_DATE, src.EXPIRY_DATE, src.UPDATE_TIMESTAMP); --- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID FM code linking with I in an idempotent way +-- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID XP code linking with L in an idempotent way MERGE INTO THE.CLIENT_TYPE_COMPANY_XREF tgt USING ( SELECT 'L' AS CLIENT_TYPE_CODE, @@ -127,7 +127,7 @@ WHEN NOT MATCHED THEN INSERT (CLIENT_TYPE_CODE, REGISTRY_COMPANY_TYPE_CODE, ADD_USERID, ADD_TIMESTAMP, UPDATE_USERID, UPDATE_TIMESTAMP) VALUES (src.CLIENT_TYPE_CODE, src.REGISTRY_COMPANY_TYPE_CODE, src.ADD_USERID, src.ADD_TIMESTAMP, src.UPDATE_USERID, src.UPDATE_TIMESTAMP); --- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID FM type in an idempotent way +-- Create a new entry in the REGISTRY_COMPANY_TYPE_CODE table for the BCeID XL type in an idempotent way MERGE INTO THE.REGISTRY_COMPANY_TYPE_CODE tgt USING ( SELECT 'XL' AS REGISTRY_COMPANY_TYPE_CODE, @@ -148,7 +148,7 @@ WHEN NOT MATCHED THEN INSERT (REGISTRY_COMPANY_TYPE_CODE, DESCRIPTION, EFFECTIVE_DATE, EXPIRY_DATE, UPDATE_TIMESTAMP) VALUES (src.REGISTRY_COMPANY_TYPE_CODE, src.DESCRIPTION, src.EFFECTIVE_DATE, src.EXPIRY_DATE, src.UPDATE_TIMESTAMP); --- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID FM code linking with I in an idempotent way +-- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID XL code linking with L in an idempotent way MERGE INTO THE.CLIENT_TYPE_COMPANY_XREF tgt USING ( SELECT 'L' AS CLIENT_TYPE_CODE, @@ -170,3 +170,24 @@ WHEN NOT MATCHED THEN INSERT (CLIENT_TYPE_CODE, REGISTRY_COMPANY_TYPE_CODE, ADD_USERID, ADD_TIMESTAMP, UPDATE_USERID, UPDATE_TIMESTAMP) VALUES (src.CLIENT_TYPE_CODE, src.REGISTRY_COMPANY_TYPE_CODE, src.ADD_USERID, src.ADD_TIMESTAMP, src.UPDATE_USERID, src.UPDATE_TIMESTAMP); +-- Create a new entry in the CLIENT_TYPE_COMPANY_XREF table for the BCeID FM code linking with P in an idempotent way +MERGE INTO THE.CLIENT_TYPE_COMPANY_XREF tgt +USING ( + SELECT 'P' AS CLIENT_TYPE_CODE, + 'FM' AS REGISTRY_COMPANY_TYPE_CODE, + 'CLIADMIN' AS ADD_USERID, + TIMESTAMP '2023-11-29 13:00:40.0' AS ADD_TIMESTAMP, + 'CLIADMIN' AS UPDATE_USERID, + TIMESTAMP '2023-11-29 13:00:40.0' AS UPDATE_TIMESTAMP + FROM DUAL +) src +ON (tgt.CLIENT_TYPE_CODE = src.CLIENT_TYPE_CODE AND tgt.REGISTRY_COMPANY_TYPE_CODE = src.REGISTRY_COMPANY_TYPE_CODE) +WHEN MATCHED THEN + UPDATE SET + tgt.ADD_USERID = src.ADD_USERID, + tgt.ADD_TIMESTAMP = src.ADD_TIMESTAMP, + tgt.UPDATE_USERID = src.UPDATE_USERID, + tgt.UPDATE_TIMESTAMP = src.UPDATE_TIMESTAMP +WHEN NOT MATCHED THEN + INSERT (CLIENT_TYPE_CODE, REGISTRY_COMPANY_TYPE_CODE, ADD_USERID, ADD_TIMESTAMP, UPDATE_USERID, UPDATE_TIMESTAMP) + VALUES (src.CLIENT_TYPE_CODE, src.REGISTRY_COMPANY_TYPE_CODE, src.ADD_USERID, src.ADD_TIMESTAMP, src.UPDATE_USERID, src.UPDATE_TIMESTAMP); \ No newline at end of file