Revision 4734
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
414 | 414 |
CREATE TABLE locationplace ( |
415 | 415 |
locationplace_id int(11) NOT NULL, |
416 | 416 |
location_id int(11) NOT NULL, |
417 |
placepath_id int(11) NOT NULL |
|
417 |
placepath_id int(11) NOT NULL, |
|
418 |
identifier_id int(11) |
|
418 | 419 |
); |
419 | 420 |
|
420 | 421 |
|
... | ... | |
3277 | 3278 |
|
3278 | 3279 |
|
3279 | 3280 |
-- |
3280 |
-- Name: locationplace_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3281 |
-- |
|
3282 |
|
|
3283 |
ALTER TABLE locationplace |
|
3284 |
ADD CONSTRAINT locationplace_unique UNIQUE (location_id, placepath_id); |
|
3285 |
|
|
3286 |
|
|
3287 |
-- |
|
3288 | 3281 |
-- Name: method_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3289 | 3282 |
-- |
3290 | 3283 |
|
... | ... | |
3841 | 3834 |
|
3842 | 3835 |
|
3843 | 3836 |
-- |
3837 |
-- Name: locationplace_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
3838 |
-- |
|
3839 |
|
|
3840 |
|
|
3841 |
|
|
3842 |
|
|
3843 |
-- |
|
3844 | 3844 |
-- Name: method_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
3845 | 3845 |
-- |
3846 | 3846 |
|
... | ... | |
4495 | 4495 |
|
4496 | 4496 |
|
4497 | 4497 |
-- |
4498 |
-- Name: locationplace_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
4499 |
-- |
|
4500 |
|
|
4501 |
|
|
4502 |
|
|
4503 |
|
|
4504 |
-- |
|
4498 | 4505 |
-- Name: locationplace_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
4499 | 4506 |
-- |
4500 | 4507 |
|
schemas/vegbien.sql | ||
---|---|---|
668 | 668 |
CREATE TABLE locationplace ( |
669 | 669 |
locationplace_id integer NOT NULL, |
670 | 670 |
location_id integer NOT NULL, |
671 |
placepath_id integer NOT NULL |
|
671 |
placepath_id integer NOT NULL, |
|
672 |
identifier_id integer |
|
672 | 673 |
); |
673 | 674 |
|
674 | 675 |
|
... | ... | |
3876 | 3877 |
|
3877 | 3878 |
|
3878 | 3879 |
-- |
3879 |
-- Name: locationplace_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3880 |
-- |
|
3881 |
|
|
3882 |
ALTER TABLE ONLY locationplace |
|
3883 |
ADD CONSTRAINT locationplace_unique UNIQUE (location_id, placepath_id); |
|
3884 |
|
|
3885 |
|
|
3886 |
-- |
|
3887 | 3880 |
-- Name: method_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3888 | 3881 |
-- |
3889 | 3882 |
|
... | ... | |
4440 | 4433 |
|
4441 | 4434 |
|
4442 | 4435 |
-- |
4436 |
-- Name: locationplace_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4437 |
-- |
|
4438 |
|
|
4439 |
CREATE UNIQUE INDEX locationplace_unique ON locationplace USING btree (location_id, placepath_id, (COALESCE(identifier_id, 2147483647))); |
|
4440 |
|
|
4441 |
|
|
4442 |
-- |
|
4443 | 4443 |
-- Name: method_accessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4444 | 4444 |
-- |
4445 | 4445 |
|
... | ... | |
5113 | 5113 |
|
5114 | 5114 |
|
5115 | 5115 |
-- |
5116 |
-- Name: locationplace_identifier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
|
5117 |
-- |
|
5118 |
|
|
5119 |
ALTER TABLE ONLY locationplace |
|
5120 |
ADD CONSTRAINT locationplace_identifier_id_fkey FOREIGN KEY (identifier_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE; |
|
5121 |
|
|
5122 |
|
|
5123 |
-- |
|
5116 | 5124 |
-- Name: locationplace_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - |
5117 | 5125 |
-- |
5118 | 5126 |
|
Also available in: Unified diff
schemas/vegbien.sql: locationplace: Added identifier_id, so that different identifiers (e.g. the data provider and GNRS) can provide separate locationplaces even if the standardized name happens to be the same as the original name