Revision 3201
Added by Aaron Marcuse-Kubitza over 12 years ago
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