-
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: dropping cc certification_url_has_matches
- Loading branch information
Showing
7 changed files
with
68 additions
and
23 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
28 changes: 28 additions & 0 deletions
28
schema/deploy/computed_columns/certification_url_hash_matches@v1.16.0.sql
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,28 @@ | ||
-- Deploy ggircs-portal:computed_columns/certification_url_hash_matches_current to pg | ||
-- requires: function_current_form_result_md5 | ||
-- requires: tables/certification_url | ||
|
||
begin; | ||
|
||
create or replace function ggircs_portal.certification_url_hash_matches( | ||
certification_url ggircs_portal.certification_url | ||
) | ||
returns boolean | ||
as | ||
$function$ | ||
declare | ||
result boolean; | ||
current_md5 bytea; | ||
begin | ||
current_md5 := (select ggircs_portal_private.current_form_results_md5(certification_url.application_id, certification_url.version_number)); | ||
select certification_url.form_results_md5 = current_md5 into result; | ||
return result; | ||
end; | ||
$function$ | ||
language 'plpgsql' stable; | ||
|
||
grant execute on function ggircs_portal.certification_url_hash_matches to ciip_administrator, ciip_analyst, ciip_industry_user; | ||
|
||
comment on function ggircs_portal.certification_url_hash_matches is 'Computed column for graphql to traverse to show if the current hash of form results matches the form_results_md5 in certification_url'; | ||
|
||
commit; |
25 changes: 23 additions & 2 deletions
25
schema/revert/computed_columns/certification_url_hash_matches.sql
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 |
---|---|---|
@@ -1,7 +1,28 @@ | ||
-- Revert ggircs-portal:computed_columns/certification_url_hash_matches from pg | ||
-- Deploy ggircs-portal:computed_columns/certification_url_hash_matches_current to pg | ||
-- requires: function_current_form_result_md5 | ||
-- requires: tables/certification_url | ||
|
||
begin; | ||
|
||
drop function ggircs_portal.certification_url_hash_matches; | ||
create or replace function ggircs_portal.certification_url_hash_matches( | ||
certification_url ggircs_portal.certification_url | ||
) | ||
returns boolean | ||
as | ||
$function$ | ||
declare | ||
result boolean; | ||
current_md5 bytea; | ||
begin | ||
current_md5 := (select ggircs_portal_private.current_form_results_md5(certification_url.application_id, certification_url.version_number)); | ||
select certification_url.form_results_md5 = current_md5 into result; | ||
return result; | ||
end; | ||
$function$ | ||
language 'plpgsql' stable; | ||
|
||
grant execute on function ggircs_portal.certification_url_hash_matches to ciip_administrator, ciip_analyst, ciip_industry_user; | ||
|
||
comment on function ggircs_portal.certification_url_hash_matches is 'Computed column for graphql to traverse to show if the current hash of form results matches the form_results_md5 in certification_url'; | ||
|
||
commit; |
7 changes: 7 additions & 0 deletions
7
schema/revert/computed_columns/certification_url_hash_matches@v1.16.0.sql
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,7 @@ | ||
-- Revert ggircs-portal:computed_columns/certification_url_hash_matches from pg | ||
|
||
begin; | ||
|
||
drop function ggircs_portal.certification_url_hash_matches; | ||
|
||
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
7 changes: 7 additions & 0 deletions
7
schema/verify/computed_columns/certification_url_hash_matches@v1.16.0.sql
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,7 @@ | ||
-- Verify ggircs-portal:computed_columns/certification_url_hash_matches on pg | ||
|
||
begin; | ||
|
||
select pg_get_functiondef('ggircs_portal.certification_url_hash_matches(ggircs_portal.certification_url)'::regprocedure); | ||
|
||
rollback; |