Project

General

Profile

« Previous | Next » 

Revision 5077

schemas/vegbien.sql: taxonpath: Made it datasource-general and uniquely identified only by its taxonomicnamewithauthor so that the taxonpaths imported by the TNRS datasource will be matched and used directly when the other datasources are imported

View differences:

vegbien.sql
1153 1153

  
1154 1154
CREATE TABLE taxonpath (
1155 1155
    taxonpath_id integer NOT NULL,
1156
    datasource_id integer NOT NULL,
1157
    plantcode text,
1158 1156
    canon_taxonpath_id integer,
1159 1157
    taxon_id integer,
1160 1158
    taxonomicname text,
......
1188 1186

  
1189 1187

  
1190 1188
--
1191
-- Name: COLUMN taxonpath.plantcode; Type: COMMENT; Schema: public; Owner: -
1192
--
1193

  
1194
COMMENT ON COLUMN taxonpath.plantcode IS 'The datasource''s unique identifier for this taxonomic name.';
1195

  
1196

  
1197
--
1198 1189
-- Name: COLUMN taxonpath.canon_taxonpath_id; Type: COMMENT; Schema: public; Owner: -
1199 1190
--
1200 1191

  
......
4774 4765

  
4775 4766

  
4776 4767
--
4777
-- Name: taxonpath_unique_within_datasource_by_code; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4768
-- Name: taxonpath_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4778 4769
--
4779 4770

  
4780
CREATE UNIQUE INDEX taxonpath_unique_within_datasource_by_code ON taxonpath USING btree (datasource_id, (COALESCE(plantcode, '\\N'::text))) WHERE (plantcode IS NOT NULL);
4771
CREATE UNIQUE INDEX taxonpath_unique ON taxonpath USING btree (taxonomicnamewithauthor);
4781 4772

  
4782 4773

  
4783 4774
--
4784
-- Name: taxonpath_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4785
--
4786

  
4787
CREATE UNIQUE INDEX taxonpath_unique_within_datasource_by_name ON taxonpath USING btree (datasource_id, taxonomicnamewithauthor) WHERE (plantcode IS NULL);
4788

  
4789

  
4790
--
4791 4775
-- Name: taxonscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4792 4776
--
4793 4777

  
......
5789 5773

  
5790 5774

  
5791 5775
--
5792
-- Name: taxonpath_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5793
--
5794

  
5795
ALTER TABLE ONLY taxonpath
5796
    ADD CONSTRAINT taxonpath_datasource_id_fkey FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
5797

  
5798

  
5799
--
5800 5776
-- Name: taxonpath_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5801 5777
--
5802 5778

  

Also available in: Unified diff