Skip to content

Commit

Permalink
feat: add return type for search function
Browse files Browse the repository at this point in the history
  • Loading branch information
dleard committed May 26, 2020
1 parent 546d1b4 commit 790c79b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions schema/deploy/types/search_certification_url_result.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Deploy ggircs-portal:types/search_certification_url_result to pg
-- requires: schema_ggircs_portal

begin;

create type ggircs_portal.facility_search_result as (
id integer,
application_id integer,
version_number integer,
facility_name varchar(1000),
operator_name varchar(1000),
application_revision_status ggircs_portal.ciip_application_revision_status,
certified_at timestamptz,
certified_by varchar(1000),
user_first_name varchar(1000),
user_last_name varchar(1000)
);

comment on type ggircs_portal.facility_search_result is '@primaryKey (id)';
commit;
7 changes: 7 additions & 0 deletions schema/revert/types/search_certification_url_result.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Revert ggircs-portal:types/search_certification_url_result from pg

begin;

drop type ggircs_portal.search_certification_url_result;

commit;
1 change: 1 addition & 0 deletions schema/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ types/ciip_form_result_status [schema_ggircs_portal] 2020-01-13T19:14:50Z Dylan
types/review_comment_type [schema_ggircs_portal] 2020-01-13T20:18:15Z Dylan Leard <dylan@button.is> # The type of a review comment
types/application_search_result [schema_ggircs_portal types/ciip_application_revision_status] 2019-12-12T23:22:59Z Dylan Leard <dylan@button.is> # Return type for searching and listing applications
types/ciip_product_state [schema_ggircs_portal] 2020-05-04T17:14:21Z Dylan Leard <dylan@button.is> # product_state enum type
types/search_certification_url_result [schema_ggircs_portal] 2020-05-22T18:42:07Z Dylan Leard <dylan@button.is> # Custom return type for the certification_url search function
tables/ciip_user [schema_ggircs_portal trigger_functions/update_timestamps] 2019-07-11T18:32:05Z Hamza Javed <hamza@button.is> # Create a User table for GGIRCS Industry Portal (GIP)
trigger_functions/set_user_id [function_session tables/ciip_user] 2019-12-10T20:02:31Z Dylan Leard <dylan@button.is> # Trigger function updates the user_id field
trigger_functions/checksum_form_results [schema_ggircs_portal_private] 2020-01-13T23:21:05Z Dylan Leard <dylan@button.is> # Trigger function checksums current submtted and previous submitted form result & changes form result status on result
Expand Down
13 changes: 13 additions & 0 deletions schema/verify/types/search_certification_url_result.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Verify ggircs-portal:types/search_certification_url_result on pg

begin;

do $$
begin
assert (
select true from pg_catalog.pg_type where typname = 'search_certification_url_result'
), 'type "search_certification_url_result" is not defined';
end;
$$;

rollback;

0 comments on commit 790c79b

Please sign in to comment.