Project

General

Profile

« Previous | Next » 

Revision 5134

schemas/vegbien.sql: taxonpath: Added back datasource_id, plantcode to make taxonpath datasource-specific again. This way, the original name components can still be stored in taxonpath, in addition to storing the concatenated name in a datasource-general taxonpath for use by TNRS.

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,
1156 1158
    canon_taxonpath_id integer,
1157 1159
    taxon_id integer,
1158 1160
    taxonomicname text,
......
1186 1188

  
1187 1189

  
1188 1190
--
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
--
1189 1198
-- Name: COLUMN taxonpath.canon_taxonpath_id; Type: COMMENT; Schema: public; Owner: -
1190 1199
--
1191 1200

  
......
4765 4774

  
4766 4775

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

  
4771
CREATE UNIQUE INDEX taxonpath_unique ON taxonpath USING btree (taxonomicnamewithauthor);
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);
4772 4781

  
4773 4782

  
4774 4783
--
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
--
4775 4791
-- Name: taxonscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4776 4792
--
4777 4793

  
......
5773 5789

  
5774 5790

  
5775 5791
--
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
--
5776 5800
-- Name: taxonpath_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5777 5801
--
5778 5802

  

Also available in: Unified diff