Revision 3201
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
638 | 638 |
CREATE TABLE location ( |
639 | 639 |
location_id int(11) NOT NULL, |
640 | 640 |
parent_id int(11), |
641 |
datasource_id int(11), |
|
642 |
sourceaccessioncode text, |
|
641 | 643 |
centerlatitude double precision, |
642 | 644 |
centerlongitude double precision, |
643 | 645 |
locationaccuracy double precision, |
... | ... | |
3114 | 3116 |
|
3115 | 3117 |
|
3116 | 3118 |
-- |
3119 |
-- Name: location_unique_sourceaccessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3120 |
-- |
|
3121 |
|
|
3122 |
ALTER TABLE location |
|
3123 |
ADD CONSTRAINT location_unique_sourceaccessioncode UNIQUE (datasource_id, sourceaccessioncode); |
|
3124 |
|
|
3125 |
|
|
3126 |
-- |
|
3117 | 3127 |
-- Name: location_unique_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3118 | 3128 |
-- |
3119 | 3129 |
|
... | ... | |
5088 | 5098 |
|
5089 | 5099 |
|
5090 | 5100 |
-- |
5101 |
-- Name: location_datasource_id; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5102 |
-- |
|
5103 |
|
|
5104 |
|
|
5105 |
|
|
5106 |
|
|
5107 |
-- |
|
5091 | 5108 |
-- Name: location_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: - |
5092 | 5109 |
-- |
5093 | 5110 |
|
schemas/vegbien.sql | ||
---|---|---|
935 | 935 |
CREATE TABLE location ( |
936 | 936 |
location_id integer NOT NULL, |
937 | 937 |
parent_id integer, |
938 |
datasource_id integer, |
|
939 |
sourceaccessioncode text, |
|
938 | 940 |
centerlatitude double precision, |
939 | 941 |
centerlongitude double precision, |
940 | 942 |
locationaccuracy double precision, |
... | ... | |
3648 | 3650 |
|
3649 | 3651 |
|
3650 | 3652 |
-- |
3653 |
-- Name: location_unique_sourceaccessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3654 |
-- |
|
3655 |
|
|
3656 |
ALTER TABLE ONLY location |
|
3657 |
ADD CONSTRAINT location_unique_sourceaccessioncode UNIQUE (datasource_id, sourceaccessioncode); |
|
3658 |
|
|
3659 |
|
|
3660 |
-- |
|
3651 | 3661 |
-- Name: location_unique_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3652 | 3662 |
-- |
3653 | 3663 |
|
... | ... | |
5628 | 5638 |
|
5629 | 5639 |
|
5630 | 5640 |
-- |
5641 |
-- Name: location_datasource_id; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5642 |
-- |
|
5643 |
|
|
5644 |
ALTER TABLE ONLY location |
|
5645 |
ADD CONSTRAINT location_datasource_id FOREIGN KEY (datasource_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
5646 |
|
|
5647 |
|
|
5648 |
-- |
|
5631 | 5649 |
-- Name: location_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: - |
5632 | 5650 |
-- |
5633 | 5651 |
|
Also available in: Unified diff
schemas/vegbien.sql: location: Added datasource_id and sourceaccessioncode so locations can be uniquely specified by the input datasource, rather than being created automatically for each locationevent