Revision 5603
Added by Aaron Marcuse-Kubitza about 12 years ago
vegbien.my.sql | ||
---|---|---|
2377 | 2377 |
-- |
2378 | 2378 |
|
2379 | 2379 |
CREATE TABLE taxonconcept_ancestor ( |
2380 |
taxonconcept_id int(11) NOT NULL,
|
|
2380 |
descendant_id int(11) NOT NULL,
|
|
2381 | 2381 |
ancestor_id int(11) NOT NULL |
2382 | 2382 |
); |
2383 | 2383 |
|
... | ... | |
3527 | 3527 |
-- |
3528 | 3528 |
|
3529 | 3529 |
ALTER TABLE taxonconcept_ancestor |
3530 |
ADD CONSTRAINT taxonconcept_ancestor_pkey PRIMARY KEY (taxonconcept_id, ancestor_id);
|
|
3530 |
ADD CONSTRAINT taxonconcept_ancestor_pkey PRIMARY KEY (descendant_id, ancestor_id);
|
|
3531 | 3531 |
|
3532 | 3532 |
|
3533 | 3533 |
-- |
... | ... | |
4010 | 4010 |
-- Name: taxonconcept_ancestor_descendants; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4011 | 4011 |
-- |
4012 | 4012 |
|
4013 |
CREATE INDEX taxonconcept_ancestor_descendants ON taxonconcept_ancestor (ancestor_id, taxonconcept_id);
|
|
4013 |
CREATE INDEX taxonconcept_ancestor_descendants ON taxonconcept_ancestor (ancestor_id, descendant_id);
|
|
4014 | 4014 |
|
4015 | 4015 |
|
4016 | 4016 |
-- |
... | ... | |
4916 | 4916 |
|
4917 | 4917 |
|
4918 | 4918 |
-- |
4919 |
-- Name: taxonconcept_ancestor_taxonconcept_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
4919 |
-- Name: taxonconcept_ancestor_descendant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
4920 | 4920 |
-- |
4921 | 4921 |
|
4922 | 4922 |
ALTER TABLE taxonconcept_ancestor |
4923 |
ADD CONSTRAINT taxonconcept_ancestor_taxonconcept_id_fkey FOREIGN KEY (taxonconcept_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
4923 |
ADD CONSTRAINT taxonconcept_ancestor_descendant_id_fkey FOREIGN KEY (descendant_id) REFERENCES taxonconcept(taxonconcept_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
4924 | 4924 |
|
4925 | 4925 |
|
4926 | 4926 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: taxonconcept_ancestor: Renamed taxonconcept_id to descendant_id to emphasize the direction of the relationship between the two taxonconcepts