-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removing certification email and md5 triggers on certification_url
- Loading branch information
Showing
4 changed files
with
86 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,12 @@ | ||
-- Deploy ggircs-portal:tables/certification_url_001 to pg | ||
-- requires: tables/certification_url | ||
|
||
BEGIN; | ||
|
||
drop trigger _certification_request_email on ggircs_portal.certification_url; | ||
drop trigger _signed_by_certifier_email on ggircs_portal.certification_url; | ||
drop trigger _recertification_request on ggircs_portal.certification_url; | ||
drop trigger _create_form_result_md5 on ggircs_portal.certification_url; | ||
drop trigger _check_form_result_md5 on ggircs_portal.certification_url; | ||
|
||
COMMIT; |
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,31 @@ | ||
-- Revert ggircs-portal:tables/certification_url_001 from pg | ||
|
||
BEGIN; | ||
|
||
|
||
create trigger _create_form_result_md5 | ||
before insert on ggircs_portal.certification_url | ||
for each row | ||
execute procedure ggircs_portal_private.signature_md5(); | ||
|
||
create trigger _check_form_result_md5 | ||
before update of certification_signature on ggircs_portal.certification_url | ||
for each row | ||
execute procedure ggircs_portal_private.signature_md5(); | ||
|
||
create trigger _certification_request_email | ||
before update of certifier_email on ggircs_portal.certification_url | ||
for each row | ||
execute procedure ggircs_portal_private.run_graphile_worker_job('certification_request'); | ||
|
||
create trigger _signed_by_certifier_email | ||
before update of certification_signature on ggircs_portal.certification_url | ||
for each row | ||
execute procedure ggircs_portal_private.run_graphile_worker_job('signed_by_certifier'); | ||
|
||
create trigger _recertification_request | ||
before update of recertification_request_sent on ggircs_portal.certification_url | ||
for each row | ||
execute procedure ggircs_portal_private.run_graphile_worker_job('recertification'); | ||
|
||
COMMIT; |
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
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,42 @@ | ||
-- Verify ggircs-portal:tables/certification_url_001 on pg | ||
|
||
BEGIN; | ||
|
||
do $$ | ||
begin | ||
|
||
if (select exists(select * from pg_trigger where tgname='_certification_request_email' and tgrelid='ggircs_portal.certification_url'::regclass)) then | ||
raise exception 'trigger _certification_request_email exists on ggircs_portal.certification_url when it should not'; | ||
else | ||
perform true; | ||
end if; | ||
|
||
if (select exists(select * from pg_trigger where tgname='_signed_by_certifier_email' and tgrelid='ggircs_portal.certification_url'::regclass)) then | ||
raise exception 'trigger _signed_by_certifier_email exists on ggircs_portal.certification_url when it should not'; | ||
else | ||
perform true; | ||
end if; | ||
|
||
if (select exists(select * from pg_trigger where tgname='_recertification_request' and tgrelid='ggircs_portal.certification_url'::regclass)) then | ||
raise exception 'trigger _recertification_request exists on ggircs_portal.certification_url when it should not'; | ||
else | ||
perform true; | ||
end if; | ||
|
||
if (select exists(select * from pg_trigger where tgname='_create_form_result_md5' and tgrelid='ggircs_portal.certification_url'::regclass)) then | ||
raise exception 'trigger _create_form_result_md5 exists on ggircs_portal.certification_url when it should not'; | ||
else | ||
perform true; | ||
end if; | ||
|
||
if (select exists(select * from pg_trigger where tgname='_check_form_result_md5' and tgrelid='ggircs_portal.certification_url'::regclass)) then | ||
raise exception 'trigger _check_form_result_md5 exists on ggircs_portal.certification_url when it should not'; | ||
else | ||
perform true; | ||
end if; | ||
|
||
end; | ||
$$; | ||
|
||
|
||
ROLLBACK; |