Project

General

Profile

« Previous | Next » 

Revision 3727

schemas/vegbien.sql: stemobservation: Renamed stemobservation_unique_accessioncode to stemobservation_unique_within_plantobservation and also apply it to NULL sourceaccessioncodes, so that a plantobservation can have a single stemobservation for its single stem's traits without needing a separate sourceaccessioncode for it

View differences:

schemas/vegbien.my.sql
3465 3465

  
3466 3466

  
3467 3467
--
3468
-- Name: stemobservation_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3469
--
3470

  
3471
ALTER TABLE stemobservation
3472
    ADD CONSTRAINT stemobservation_unique_accessioncode UNIQUE (plantobservation_id, sourceaccessioncode);
3473

  
3474

  
3475
--
3476 3468
-- Name: stemobservation_unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3477 3469
--
3478 3470

  
......
3861 3853

  
3862 3854

  
3863 3855
--
3856
-- Name: stemobservation_unique_within_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3857
--
3858

  
3859

  
3860

  
3861

  
3862
--
3864 3863
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3865 3864
--
3866 3865

  
schemas/vegbien.sql
4014 4014

  
4015 4015

  
4016 4016
--
4017
-- Name: stemobservation_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4018
--
4019

  
4020
ALTER TABLE ONLY stemobservation
4021
    ADD CONSTRAINT stemobservation_unique_accessioncode UNIQUE (plantobservation_id, sourceaccessioncode);
4022

  
4023

  
4024
--
4025 4017
-- Name: stemobservation_unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4026 4018
--
4027 4019

  
......
4407 4399

  
4408 4400

  
4409 4401
--
4402
-- Name: stemobservation_unique_within_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4403
--
4404

  
4405
CREATE UNIQUE INDEX stemobservation_unique_within_plantobservation ON stemobservation USING btree (plantobservation_id, (COALESCE(sourceaccessioncode, '\\N'::text)));
4406

  
4407

  
4408
--
4410 4409
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4411 4410
--
4412 4411

  

Also available in: Unified diff