-
-
Save indy-singh/6ccd86ff859e7cdad2ec1bf73a61445c to your computer and use it in GitHub Desktop.
proposal.proposal.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
-- Table: proposal.proposal | |
-- DROP TABLE proposal.proposal; | |
CREATE TABLE proposal.proposal | |
( | |
id bigserial NOT NULL, | |
reference uuid NOT NULL, | |
system_id integer NOT NULL, | |
legacy_id integer NOT NULL, | |
organisation_id integer, | |
legacy_organisation_id integer NOT NULL, | |
has_been_anonymised boolean NOT NULL, | |
external_source character varying, | |
CONSTRAINT pk_proposal PRIMARY KEY (id), | |
CONSTRAINT proposal_reference_key UNIQUE (reference), | |
CONSTRAINT proposal_system_id_legacy_id_key UNIQUE (system_id, legacy_id) | |
); | |
-- Index: proposal.proposal_has_been_anonymised_system_id_legacy_organisation__idx | |
-- DROP INDEX proposal.proposal_has_been_anonymised_system_id_legacy_organisation__idx; | |
CREATE INDEX proposal_has_been_anonymised_system_id_legacy_organisation__idx | |
ON proposal.proposal | |
USING btree | |
(has_been_anonymised, system_id, legacy_organisation_id); | |
-- Index: proposal.proposal_has_been_anonymised_system_id_legacy_organisation_idx1 | |
-- DROP INDEX proposal.proposal_has_been_anonymised_system_id_legacy_organisation_idx1; | |
CREATE INDEX proposal_has_been_anonymised_system_id_legacy_organisation_idx1 | |
ON proposal.proposal | |
USING btree | |
(has_been_anonymised, system_id, legacy_organisation_id, reference); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment