Revision 3741
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/vegbien.sql | ||
---|---|---|
4189 | 4189 |
-- Name: locationevent_unique_within_location; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4190 | 4190 |
-- |
4191 | 4191 |
|
4192 |
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree (location_id, (COALESCE(obsstartdate, 'infinity'::timestamp with time zone))) WHERE ((parent_id IS NULL) AND (sourceaccessioncode IS NULL));
|
|
4192 |
CREATE UNIQUE INDEX locationevent_unique_within_location ON locationevent USING btree (location_id, (COALESCE(obsstartdate, 'infinity'::timestamp with time zone))) WHERE (((parent_id IS NULL) AND (sourceaccessioncode IS NULL)) AND (authorlocationcode IS NULL));
|
|
4193 | 4193 |
|
4194 | 4194 |
|
4195 | 4195 |
-- |
... | ... | |
4378 | 4378 |
-- Name: stemobservation_plantobservation_1_to_1; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4379 | 4379 |
-- |
4380 | 4380 |
|
4381 |
CREATE UNIQUE INDEX stemobservation_plantobservation_1_to_1 ON stemobservation USING btree (plantobservation_id) WHERE (sourceaccessioncode IS NULL);
|
|
4381 |
CREATE UNIQUE INDEX stemobservation_plantobservation_1_to_1 ON stemobservation USING btree (plantobservation_id) WHERE ((sourceaccessioncode IS NULL) AND (authorstemcode IS NULL));
|
|
4382 | 4382 |
|
4383 | 4383 |
|
4384 | 4384 |
-- |
Also available in: Unified diff
schemas/vegbien.sql: 1_to_1 and *_unique_within unique indexes with a `WHERE sourceaccessioncode IS NULL` filter: Added IS NULL filters for other unique keys, so that these fallback indexes would only be used if there was no (or no other) way to uniquely identify their tables. For *_1_to_1 unique indexes, this is the case for specimens data.