Skip to content

Commit

Permalink
[EASI-3845] IPC Updates (#912)
Browse files Browse the repository at this point in the history
* feat: migration to remove Sue Nonemaker and Philip Tennant, add Alistair Quatre and Brandon Cooper

* chore: formatted sql
  • Loading branch information
OddTomBrooks authored Jan 23, 2024
1 parent 07c7d41 commit 0a01fe1
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions migrations/V138__IPC_Updates.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Remove relevant points of contact */
WITH poc_solkeys_to_remove(SolutionKey) AS (
VALUES('IPC')
),
pocs_to_remove(POCName) AS (
VALUES('Sue Nonemaker'),
('Philip Tennant')
)
DELETE FROM possible_operational_solution_contact
WHERE possible_operational_solution_id IN (
SELECT id
FROM possible_operational_solution
WHERE CAST(sol_key as TEXT) IN (
SELECT SolutionKey
FROM poc_solkeys_to_remove
)
)
AND name = ANY(
SELECT POCName
FROM pocs_to_remove
);

/* Set up new POCs */
WITH pocs(
SolutionName,
SolutionKey,
Name,
Email,
Role,
IsTeam
) AS (
VALUES (
'Innovation Payment Contractor (IPC)',
'IPC',
'Alistair Quatre',
'[email protected]',
'Subject Matter Expert',
FALSE
),
(
'Innovation Payment Contractor (IPC)',
'IPC',
'Brandon Cooper',
'[email protected]',
'Subject Matter Expert',
FALSE
)
)
INSERT INTO possible_operational_solution_contact(
id,
possible_operational_solution_id,
name,
email,
role,
is_team,
created_by,
created_dts
)
SELECT gen_random_uuid() AS id,
pos.id as possible_operational_solution_id,
pocs.name AS name,
pocs.email AS email,
pocs.role AS role,
pocs.IsTeam as is_team,
'00000001-0001-0001-0001-000000000001' AS created_by, --System account
current_timestamp AS created_dts
FROM pocs
JOIN possible_operational_solution pos on CAST(pos.sol_key as TEXT) = pocs.solutionkey

0 comments on commit 0a01fe1

Please sign in to comment.