Skip to content

Commit

Permalink
fix: add uindex to application (fixes multiple 'apply' button clicks …
Browse files Browse the repository at this point in the history
…bug)
  • Loading branch information
dleard committed Jun 30, 2020
1 parent 94bf98a commit c6ecdee
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions schema/deploy/tables/application_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Deploy ggircs-portal:tables/application_001 to pg
-- requires: tables/application

begin;

create unique index application_facility_year_uindex on ggircs_portal.application(facility_id, reporting_year);

commit;
7 changes: 7 additions & 0 deletions schema/revert/tables/application_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Revert ggircs-portal:tables/application_001 from pg

begin;

drop index ggircs_portal.application_facility_year_uindex;

commit;
1 change: 1 addition & 0 deletions schema/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ swrs_functions/import_swrs_organisation_facility [swrs_functions/import_swrs_org
tables/organisation_001 [tables/organisation] 2020-06-25T21:27:04Z Dylan Leard <dylan@button.is> # Migration: add uindex for swrs_organisation_id
tables/facility_001 [tables/facility] 2020-06-25T21:36:21Z Dylan Leard <dylan@button.is> # Migration: add unique index for swrs_facility_id
@v1.0.0-rc.8 2020-06-26T15:55:59Z Matthieu Foucault <matthieu@button.is> # release v1.0.0-rc.8
tables/application_001 [tables/application] 2020-06-29T17:43:45Z Dylan Leard <dylan@button.is> # Migration: add uindex for application table on facility_id + reporting_year
12 changes: 12 additions & 0 deletions schema/verify/tables/application_001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Verify ggircs-portal:tables/application_001 on pg

begin;

select exists(
select * from pg_indexes
where schemaname='ggircs_portal'
and tablename='application'
and indexname='application_facility_year_uindex'
);

rollback;

0 comments on commit c6ecdee

Please sign in to comment.