Revision 11074
Added by Aaron Marcuse-Kubitza over 11 years ago
vegbien.sql | ||
---|---|---|
1977 | 1977 |
parent_id integer, |
1978 | 1978 |
location_id integer, |
1979 | 1979 |
project_id integer, |
1980 |
stratum_id integer, |
|
1980 | 1981 |
authoreventcode text, |
1981 | 1982 |
previous_id integer, |
1982 | 1983 |
obsstartdate date, |
... | ... | |
4247 | 4248 |
|
4248 | 4249 |
CREATE TABLE stratum ( |
4249 | 4250 |
stratum_id integer NOT NULL, |
4250 |
locationevent_id integer NOT NULL, |
|
4251 | 4251 |
stratumname text, |
4252 | 4252 |
stratumheight double precision, |
4253 | 4253 |
stratumbase double precision, |
... | ... | |
6601 | 6601 |
|
6602 | 6602 |
|
6603 | 6603 |
-- |
6604 |
-- Name: locationevent__stratum_id; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
6605 |
-- |
|
6606 |
|
|
6607 |
CREATE INDEX locationevent__stratum_id ON locationevent USING btree (stratum_id); |
|
6608 |
|
|
6609 |
|
|
6610 |
-- |
|
6604 | 6611 |
-- Name: locationevent_location; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6605 | 6612 |
-- |
6606 | 6613 |
|
... | ... | |
7112 | 7119 |
|
7113 | 7120 |
|
7114 | 7121 |
-- |
7115 |
-- Name: stratum_locationevent_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
7116 |
-- |
|
7117 |
|
|
7118 |
CREATE INDEX stratum_locationevent_id_idx ON stratum USING btree (locationevent_id); |
|
7119 |
|
|
7120 |
|
|
7121 |
-- |
|
7122 | 7122 |
-- Name: stratum_method_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: |
7123 | 7123 |
-- |
7124 | 7124 |
|
... | ... | |
7850 | 7850 |
|
7851 | 7851 |
|
7852 | 7852 |
-- |
7853 |
-- Name: locationevent_stratum_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
7854 |
-- |
|
7855 |
|
|
7856 |
ALTER TABLE ONLY locationevent |
|
7857 |
ADD CONSTRAINT locationevent_stratum_id_fkey FOREIGN KEY (stratum_id) REFERENCES stratum(stratum_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
7858 |
|
|
7859 |
|
|
7860 |
-- |
|
7853 | 7861 |
-- Name: locationeventcontributor_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
7854 | 7862 |
-- |
7855 | 7863 |
|
... | ... | |
8266 | 8274 |
|
8267 | 8275 |
|
8268 | 8276 |
-- |
8269 |
-- Name: stratum_locationevent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
8270 |
-- |
|
8271 |
|
|
8272 |
ALTER TABLE ONLY stratum |
|
8273 |
ADD CONSTRAINT stratum_locationevent_id_fkey FOREIGN KEY (locationevent_id) REFERENCES locationevent(locationevent_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
8274 |
|
|
8275 |
|
|
8276 |
-- |
|
8277 | 8277 |
-- Name: stratum_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
8278 | 8278 |
-- |
8279 | 8279 |
|
Also available in: Unified diff
schemas/vegbien.sql: link locationevent to stratum instead of the other way around (similar to how it's represented in normalized VegCore as stratum_event->stratum, rather than stratum->taxa_sampling_event). this works around column-based import's lack of support for linking two tables together via two separate routes (in this case locationevent->taxonoccurrence->stratum and locationevent->stratum).