Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add FM to P association #1231

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions legacy/src/test/resources/db/migration/V9__adding_l_to_l.sql
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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);
Loading