Skip to content

Commit

Permalink
fix: #1232 add flyway script to add a new client role (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 committed Mar 14, 2024
1 parent 95bc62f commit e744380
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions server/flyway/sql/V39__add_client_role.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Delete any role assignments to the CLIENT initial testing roles
DELETE FROM app_fam.fam_user_role_xref WHERE role_id IN
(SELECT role_id from app_fam.fam_role WHERE application_id IN
(SELECT application_id FROM app_fam.fam_application WHERE application_name IN ('CLIENT_DEV', 'CLIENT_TEST', 'CLIENT_PROD'))
)
;

-- Delete previously created CLIENT testing roles for client_dev, client_test and client_prod applications
DELETE FROM app_fam.fam_role WHERE application_id IN (
SELECT application_id FROM app_fam.fam_application WHERE application_name IN ('CLIENT_DEV', 'CLIENT_TEST', 'CLIENT_PROD')
);

-- Add a role for CLIENT_DEV, CLIENT_TEST and CLIENT_PROD
INSERT INTO app_fam.fam_role (
role_name,
role_purpose,
application_id,
role_type_code,
create_user,
create_date
)
VALUES ('CLIENT_EDITOR', 'Ministry role to approve/reject submissions, create client records, and perform non-administrative edits to client records', (select application_id from app_fam.fam_application where application_name = 'CLIENT_DEV'), 'C', CURRENT_USER, CURRENT_DATE),
('CLIENT_EDITOR', 'Ministry role to approve/reject submissions, create client records, and perform non-administrative edits to client records', (select application_id from app_fam.fam_application where application_name = 'CLIENT_TEST'), 'C', CURRENT_USER, CURRENT_DATE),
('CLIENT_EDITOR', 'Ministry role to approve/reject submissions, create client records, and perform non-administrative edits to client records', (select application_id from app_fam.fam_application where application_name = 'CLIENT_PROD'), 'C', CURRENT_USER, CURRENT_DATE)
;

0 comments on commit e744380

Please sign in to comment.