Project

General

Profile

« Previous | Next » 

Revision 5469

schemas/vegbien.sql: taxonconcept: Added sourceaccessioncode, and allow it to scope the taxonconcept when provided

View differences:

vegbien.sql
1136 1136
CREATE TABLE taxonconcept (
1137 1137
    taxonconcept_id integer NOT NULL,
1138 1138
    creator_id integer NOT NULL,
1139
    sourceaccessioncode text,
1139 1140
    creationdate timestamp with time zone,
1140 1141
    accepted_concept_id integer,
1141 1142
    matched_concept_id integer,
......
1154 1155
    description text,
1155 1156
    accessioncode text,
1156 1157
    CONSTRAINT taxonconcept_matched_concept_fit_fraction_range CHECK (((matched_concept_fit_fraction >= (0)::double precision) AND (matched_concept_fit_fraction <= (1)::double precision))),
1157
    CONSTRAINT taxonconcept_required_key CHECK ((((((taxonname IS NOT NULL) OR (identifyingtaxonomicname IS NOT NULL)) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR ((parent_id IS NOT NULL) AND ((creationdate IS NOT NULL) OR (author IS NOT NULL)))))
1158
    CONSTRAINT taxonconcept_required_key CHECK (((((((sourceaccessioncode IS NOT NULL) OR (taxonname IS NOT NULL)) OR (identifyingtaxonomicname IS NOT NULL)) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR ((parent_id IS NOT NULL) AND ((creationdate IS NOT NULL) OR (author IS NOT NULL)))))
1158 1159
);
1159 1160

  
1160 1161

  
......
4600 4601

  
4601 4602

  
4602 4603
--
4604
-- Name: taxonconcept_1_unique_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4605
--
4606

  
4607
CREATE UNIQUE INDEX taxonconcept_1_unique_sourceaccessioncode ON taxonconcept USING btree (creator_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
4608

  
4609

  
4610
--
4603 4611
-- Name: taxonconcept_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4604 4612
--
4605 4613

  
......
4610 4618
-- Name: taxonconcept_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4611 4619
--
4612 4620

  
4613
CREATE UNIQUE INDEX taxonconcept_unique ON taxonconcept USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(creationdate, 'infinity'::timestamp with time zone)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)));
4621
CREATE UNIQUE INDEX taxonconcept_unique ON taxonconcept USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(sourceaccessioncode, '\\N'::text)), (COALESCE(creationdate, 'infinity'::timestamp with time zone)), (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)));
4614 4622

  
4615 4623

  
4616 4624
--

Also available in: Unified diff