Project

General

Profile

« Previous | Next » 

Revision 1150

vegbien.sql: Added constraint to enforce 1:1 aggregateoccurrence:plantobservation relationship

View differences:

schemas/vegbien.my.sql
2888 2888

  
2889 2889

  
2890 2890
--
2891
-- Name: aggregateoccurrence_plantobservation_1_to_1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
2892
--
2893

  
2894
ALTER TABLE aggregateoccurrence
2895
    ADD CONSTRAINT aggregateoccurrence_plantobservation_1_to_1 UNIQUE (plantobservation_id);
2896

  
2897

  
2898
--
2891 2899
-- Name: aggregateoccurrence_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
2892 2900
--
2893 2901

  
schemas/vegbien.sql
155 155
    coverindex_id integer,
156 156
    occurrencestatus_dwc occurrencestatus_dwc DEFAULT 'present'::occurrencestatus_dwc NOT NULL,
157 157
    method_id integer,
158
    CONSTRAINT aggregateoccurrence_plantobs_count_1 CHECK (((plantobservation_id IS NULL) OR (NOT (count IS DISTINCT FROM 1))))
158
    CONSTRAINT aggregateoccurrence_plantobservation_count_1 CHECK (((plantobservation_id IS NULL) OR (NOT (count IS DISTINCT FROM 1))))
159 159
);
160 160

  
161 161

  
......
3280 3280

  
3281 3281

  
3282 3282
--
3283
-- Name: aggregateoccurrence_plantobservation_1_to_1; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3284
--
3285

  
3286
ALTER TABLE ONLY aggregateoccurrence
3287
    ADD CONSTRAINT aggregateoccurrence_plantobservation_1_to_1 UNIQUE (plantobservation_id);
3288

  
3289

  
3290
--
3283 3291
-- Name: aggregateoccurrence_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3284 3292
--
3285 3293

  

Also available in: Unified diff