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