Revision 5657
Added by Aaron Marcuse-Kubitza about 12 years ago
vegbien.sql | ||
---|---|---|
1403 | 1403 |
CREATE TABLE taxondetermination ( |
1404 | 1404 |
taxondetermination_id integer NOT NULL, |
1405 | 1405 |
taxonoccurrence_id integer NOT NULL, |
1406 |
taxonlabel_id integer NOT NULL,
|
|
1406 |
taxonverbatim_id integer NOT NULL,
|
|
1407 | 1407 |
party_id integer, |
1408 | 1408 |
role role DEFAULT 'unknown'::role NOT NULL, |
1409 | 1409 |
determinationtype text, |
... | ... | |
4803 | 4803 |
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4804 | 4804 |
-- |
4805 | 4805 |
|
4806 |
CREATE UNIQUE INDEX taxondetermination_unique ON taxondetermination USING btree (taxonoccurrence_id, isoriginal, role, (COALESCE(party_id, 2147483647)), taxonlabel_id);
|
|
4806 |
CREATE UNIQUE INDEX taxondetermination_unique ON taxondetermination USING btree (taxonoccurrence_id, isoriginal, role, (COALESCE(party_id, 2147483647)), taxonverbatim_id);
|
|
4807 | 4807 |
|
4808 | 4808 |
|
4809 | 4809 |
-- |
... | ... | |
5785 | 5785 |
|
5786 | 5786 |
|
5787 | 5787 |
-- |
5788 |
-- Name: taxondetermination_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5788 |
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5789 | 5789 |
-- |
5790 | 5790 |
|
5791 | 5791 |
ALTER TABLE ONLY taxondetermination |
5792 |
ADD CONSTRAINT taxondetermination_taxonlabel_id_fkey FOREIGN KEY (taxonlabel_id) REFERENCES taxonlabel(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5792 |
ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5793 | 5793 |
|
5794 | 5794 |
|
5795 | 5795 |
-- |
5796 |
-- Name: taxondetermination_taxonoccurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5796 |
-- Name: taxondetermination_taxonverbatim_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
5797 | 5797 |
-- |
5798 | 5798 |
|
5799 | 5799 |
ALTER TABLE ONLY taxondetermination |
5800 |
ADD CONSTRAINT taxondetermination_taxonoccurrence_id_fkey FOREIGN KEY (taxonoccurrence_id) REFERENCES taxonoccurrence(taxonoccurrence_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5800 |
ADD CONSTRAINT taxondetermination_taxonverbatim_id_fkey FOREIGN KEY (taxonverbatim_id) REFERENCES taxonverbatim(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
5801 | 5801 |
|
5802 | 5802 |
|
5803 | 5803 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: Link taxondetermination to taxonverbatim (which is a subclass of taxonlabel) instead of directly to taxonlabel. This will enable later having multiple taxonverbatims for one taxonlabel.