-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: migration to remove Sue Nonemaker and Philip Tennant, add Alistair Quatre and Brandon Cooper * chore: formatted sql
- Loading branch information
1 parent
07c7d41
commit 0a01fe1
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |