Revision 6875
Added by Aaron Marcuse-Kubitza almost 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
3374 | 3374 |
|
3375 | 3375 |
CREATE TABLE trait ( |
3376 | 3376 |
trait_id int(11) NOT NULL, |
3377 |
stemobservation_id int(11) NOT NULL,
|
|
3377 |
taxonlabel_id int(11) NOT NULL,
|
|
3378 | 3378 |
type varchar(255) NOT NULL, |
3379 | 3379 |
value varchar(255) |
3380 | 3380 |
); |
... | ... | |
6537 | 6537 |
|
6538 | 6538 |
|
6539 | 6539 |
-- |
6540 |
-- Name: trait_stemobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
6540 |
-- Name: trait_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
6541 | 6541 |
-- |
6542 | 6542 |
|
6543 | 6543 |
ALTER TABLE trait |
6544 |
ADD CONSTRAINT trait_stemobservation_id_fkey FOREIGN KEY (stemobservation_id) REFERENCES stemobservation(stemobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
6544 |
ADD CONSTRAINT trait_taxonlabel_id_fkey FOREIGN KEY (taxonlabel_id) REFERENCES taxonlabel(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
6545 | 6545 |
|
6546 | 6546 |
|
6547 | 6547 |
-- |
schemas/vegbien.sql | ||
---|---|---|
4471 | 4471 |
|
4472 | 4472 |
CREATE TABLE trait ( |
4473 | 4473 |
trait_id integer NOT NULL, |
4474 |
stemobservation_id integer NOT NULL,
|
|
4474 |
taxonlabel_id integer NOT NULL,
|
|
4475 | 4475 |
type text NOT NULL, |
4476 | 4476 |
value text |
4477 | 4477 |
); |
... | ... | |
7697 | 7697 |
|
7698 | 7698 |
|
7699 | 7699 |
-- |
7700 |
-- Name: trait_stemobservation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
7700 |
-- Name: trait_taxonlabel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
7701 | 7701 |
-- |
7702 | 7702 |
|
7703 | 7703 |
ALTER TABLE ONLY trait |
7704 |
ADD CONSTRAINT trait_stemobservation_id_fkey FOREIGN KEY (stemobservation_id) REFERENCES stemobservation(stemobservation_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
7704 |
ADD CONSTRAINT trait_taxonlabel_id_fkey FOREIGN KEY (taxonlabel_id) REFERENCES taxonlabel(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
|
|
7705 | 7705 |
|
7706 | 7706 |
|
7707 | 7707 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: trait: Linked to taxonlabel instead of stemobservation, because TraitObservation's traits are taxon-level and stem-level traits currently go in named fields instead of a stem traits table