Project

General

Profile

« Previous | Next » 

Revision 3736

schemas/vegbien.sql: unique_within unique indexes used for 1:1 relationships: Renamed to __1_to_1 to better reflect what they do

View differences:

vegbien.sql
4383 4383

  
4384 4384

  
4385 4385
--
4386
-- Name: stemobservation_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4386
-- Name: stemobservation_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4387 4387
--
4388 4388

  
4389
CREATE UNIQUE INDEX stemobservation_unique_within_datasource ON stemobservation USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
4389
CREATE UNIQUE INDEX stemobservation_plantobservation_1_to_1 ON stemobservation USING btree (plantobservation_id, (COALESCE(sourceaccessioncode, '\\N'::text)));
4390 4390

  
4391 4391

  
4392 4392
--
4393
-- Name: stemobservation_unique_within_plantobservation; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4393
-- Name: stemobservation_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4394 4394
--
4395 4395

  
4396
CREATE UNIQUE INDEX stemobservation_unique_within_plantobservation ON stemobservation USING btree (plantobservation_id, (COALESCE(sourceaccessioncode, '\\N'::text)));
4396
CREATE UNIQUE INDEX stemobservation_unique_within_datasource ON stemobservation USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
4397 4397

  
4398 4398

  
4399 4399
--
......
4418 4418

  
4419 4419

  
4420 4420
--
4421
-- Name: taxonoccurrence_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4421
-- Name: taxonoccurrence_locationevent_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4422 4422
--
4423 4423

  
4424
CREATE UNIQUE INDEX taxonoccurrence_unique_within_datasource ON taxonoccurrence USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
4424
CREATE UNIQUE INDEX taxonoccurrence_locationevent_1_to_1 ON taxonoccurrence USING btree (locationevent_id, (COALESCE(sourceaccessioncode, '\\N'::text)));
4425 4425

  
4426 4426

  
4427 4427
--
4428
-- Name: taxonoccurrence_unique_within_locationevent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4428
-- Name: taxonoccurrence_unique_within_datasource; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4429 4429
--
4430 4430

  
4431
CREATE UNIQUE INDEX taxonoccurrence_unique_within_locationevent ON taxonoccurrence USING btree (locationevent_id, (COALESCE(sourceaccessioncode, '\\N'::text)));
4431
CREATE UNIQUE INDEX taxonoccurrence_unique_within_datasource ON taxonoccurrence USING btree (datasource_id, (COALESCE(sourceaccessioncode, '\\N'::text))) WHERE (sourceaccessioncode IS NOT NULL);
4432 4432

  
4433 4433

  
4434 4434
--

Also available in: Unified diff