Project

General

Profile

« Previous | Next » 

Revision 3986

schemas/vegbien.sql: location: Added location_unique_within_parent_by_coords unique index that uses COALESCE, replacing location_unique_subplot_coords unique constraint

View differences:

schemas/vegbien.my.sql
3115 3115

  
3116 3116

  
3117 3117
--
3118
-- Name: location_unique_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3119
--
3120

  
3121
ALTER TABLE location
3122
    ADD CONSTRAINT location_unique_subplot_coords UNIQUE (parent_id, sublocationxposition, sublocationyposition);
3123

  
3124

  
3125
--
3126 3118
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3127 3119
--
3128 3120

  
......
3641 3633

  
3642 3634

  
3643 3635
--
3636
-- Name: location_unique_within_parent_by_coords; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3637
--
3638

  
3639

  
3640

  
3641

  
3642
--
3644 3643
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3645 3644
--
3646 3645

  
schemas/vegbien.sql
3646 3646

  
3647 3647

  
3648 3648
--
3649
-- Name: location_unique_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3650
--
3651

  
3652
ALTER TABLE ONLY location
3653
    ADD CONSTRAINT location_unique_subplot_coords UNIQUE (parent_id, sublocationxposition, sublocationyposition);
3654

  
3655

  
3656
--
3657 3649
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3658 3650
--
3659 3651

  
......
4172 4164

  
4173 4165

  
4174 4166
--
4167
-- Name: location_unique_within_parent_by_coords; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4168
--
4169

  
4170
CREATE UNIQUE INDEX location_unique_within_parent_by_coords ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(sublocationxposition, 'NaN'::double precision)), (COALESCE(sublocationyposition, 'NaN'::double precision))) WHERE ((parent_id IS NOT NULL) AND (sourceaccessioncode IS NULL));
4171

  
4172

  
4173
--
4175 4174
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4176 4175
--
4177 4176

  

Also available in: Unified diff