Revision 5134
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
838 | 838 |
|
839 | 839 |
CREATE TABLE taxonpath ( |
840 | 840 |
taxonpath_id int(11) NOT NULL, |
841 |
datasource_id int(11) NOT NULL, |
|
842 |
plantcode text, |
|
841 | 843 |
canon_taxonpath_id int(11), |
842 | 844 |
taxon_id int(11), |
843 | 845 |
taxonomicname text, |
... | ... | |
869 | 871 |
|
870 | 872 |
|
871 | 873 |
-- |
874 |
-- Name: COLUMN taxonpath.plantcode; Type: COMMENT; Schema: public; Owner: - |
|
875 |
-- |
|
876 |
|
|
877 |
|
|
878 |
|
|
879 |
|
|
880 |
-- |
|
872 | 881 |
-- Name: COLUMN taxonpath.canon_taxonpath_id; Type: COMMENT; Schema: public; Owner: - |
873 | 882 |
-- |
874 | 883 |
|
... | ... | |
4131 | 4140 |
|
4132 | 4141 |
|
4133 | 4142 |
-- |
4134 |
-- Name: taxonpath_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4143 |
-- Name: taxonpath_unique_within_datasource_by_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4135 | 4144 |
-- |
4136 | 4145 |
|
4137 |
CREATE UNIQUE INDEX taxonpath_unique ON taxonpath (taxonomicnamewithauthor); |
|
4138 | 4146 |
|
4139 | 4147 |
|
4148 |
|
|
4140 | 4149 |
-- |
4150 |
-- Name: taxonpath_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4151 |
-- |
|
4152 |
|
|
4153 |
|
|
4154 |
|
|
4155 |
|
|
4156 |
-- |
|
4141 | 4157 |
-- Name: taxonscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4142 | 4158 |
-- |
4143 | 4159 |
|
... | ... | |
5098 | 5114 |
|
5099 | 5115 |
|
5100 | 5116 |
-- |
5117 |
-- Name: taxonpath_datasource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5118 |
-- |
|
5119 |
|
|
5120 |
|
|
5121 |
|
|
5122 |
|
|
5123 |
-- |
|
5101 | 5124 |
-- Name: taxonpath_scope_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5102 | 5125 |
-- |
5103 | 5126 |
|
schemas/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
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.