Project

General

Profile

« Previous | Next » 

Revision 4734

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

View differences:

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