Revision 6085
Added by Aaron Marcuse-Kubitza over 11 years ago
vegbien.sql | ||
---|---|---|
4201 | 4201 |
|
4202 | 4202 |
|
4203 | 4203 |
-- |
4204 |
-- Name: threatened_taxonlabel; Type: TABLE; Schema: public; Owner: -; Tablespace: |
|
4205 |
-- |
|
4206 |
|
|
4207 |
CREATE TABLE threatened_taxonlabel ( |
|
4208 |
taxonlabel_id integer NOT NULL |
|
4209 |
); |
|
4210 |
|
|
4211 |
|
|
4212 |
-- |
|
4213 |
-- Name: threatened_taxonlabel_view; Type: VIEW; Schema: public; Owner: - |
|
4214 |
-- |
|
4215 |
|
|
4216 |
CREATE VIEW threatened_taxonlabel_view AS |
|
4217 |
SELECT accepted_taxonlabel_descendant.descendant_id AS taxonlabel_id FROM ((taxonlabel datasource_taxonlabel JOIN taxonlabel accepted_taxonlabel ON ((accepted_taxonlabel.taxonlabel_id = datasource_taxonlabel.canon_label_id))) JOIN taxonlabel_relationship accepted_taxonlabel_descendant ON ((accepted_taxonlabel_descendant.ancestor_id = accepted_taxonlabel.taxonlabel_id))) WHERE (((datasource_taxonlabel.reference_id = (SELECT reference.reference_id FROM reference WHERE (reference.shortname = 'IUCN'::text))) AND (datasource_taxonlabel.taxonomicname IS NOT NULL)) AND (accepted_taxonlabel.rank >= 'species'::taxonrank)); |
|
4218 |
|
|
4219 |
|
|
4220 |
-- |
|
4204 | 4221 |
-- Name: tnrs_input_name; Type: VIEW; Schema: public; Owner: - |
4205 | 4222 |
-- |
4206 | 4223 |
|
... | ... | |
5131 | 5148 |
|
5132 | 5149 |
|
5133 | 5150 |
-- |
5151 |
-- Data for Name: threatened_taxonlabel; Type: TABLE DATA; Schema: public; Owner: - |
|
5152 |
-- |
|
5153 |
|
|
5154 |
|
|
5155 |
|
|
5156 |
-- |
|
5134 | 5157 |
-- Data for Name: trait; Type: TABLE DATA; Schema: public; Owner: - |
5135 | 5158 |
-- |
5136 | 5159 |
|
... | ... | |
5717 | 5740 |
|
5718 | 5741 |
|
5719 | 5742 |
-- |
5743 |
-- Name: threatened_taxonlabel_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
5744 |
-- |
|
5745 |
|
|
5746 |
ALTER TABLE ONLY threatened_taxonlabel |
|
5747 |
ADD CONSTRAINT threatened_taxonlabel_pkey PRIMARY KEY (taxonlabel_id); |
|
5748 |
|
|
5749 |
|
|
5750 |
-- |
|
5720 | 5751 |
-- Name: trait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
5721 | 5752 |
-- |
5722 | 5753 |
|
... | ... | |
7278 | 7309 |
|
7279 | 7310 |
|
7280 | 7311 |
-- |
7312 |
-- Name: threatened_taxonlabel_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
7313 |
-- |
|
7314 |
|
|
7315 |
ALTER TABLE ONLY threatened_taxonlabel |
|
7316 |
ADD CONSTRAINT threatened_taxonlabel_taxonlabel_id_fkey FOREIGN KEY (taxonlabel_id) REFERENCES taxonlabel(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
7317 |
|
|
7318 |
|
|
7319 |
-- |
|
7281 | 7320 |
-- Name: trait_stemobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
7282 | 7321 |
-- |
7283 | 7322 |
|
Also available in: Unified diff
schemas/vegbien.sql: Added threatened_taxonlabel derived table with generating view threatened_taxonlabel_view