Revision 7017
Added by Aaron Marcuse-Kubitza about 12 years ago
vegbien.sql | ||
---|---|---|
6227 | 6227 |
|
6228 | 6228 |
|
6229 | 6229 |
-- |
6230 |
-- Name: location_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
6230 |
-- Name: location_unique_within_parent_by_authorlocationcode_position; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
6231 | 6231 |
-- |
6232 | 6232 |
|
6233 |
CREATE UNIQUE INDEX location_unique_within_parent ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(sourceaccessioncode, '\N'::text)), (COALESCE(authorlocationcode, '\N'::text)), (COALESCE(sublocationxposition_m, 'NaN'::double precision)), (COALESCE(sublocationyposition_m, 'NaN'::double precision))) WHERE (parent_id IS NOT NULL);
|
|
6233 |
CREATE UNIQUE INDEX location_unique_within_parent_by_authorlocationcode_position ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(authorlocationcode, '\N'::text)), (COALESCE(sublocationxposition_m, 'NaN'::double precision)), (COALESCE(sublocationyposition_m, 'NaN'::double precision))) WHERE ((parent_id IS NOT NULL) AND (authorlocationcode IS NOT NULL));
|
|
6234 | 6234 |
|
6235 | 6235 |
|
6236 | 6236 |
-- |
6237 |
-- Name: location_unique_within_parent_by_sourceaccessioncode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
6238 |
-- |
|
6239 |
|
|
6240 |
CREATE UNIQUE INDEX location_unique_within_parent_by_sourceaccessioncode ON location USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(sourceaccessioncode, '\N'::text))) WHERE ((parent_id IS NOT NULL) AND (sourceaccessioncode IS NOT NULL)); |
|
6241 |
|
|
6242 |
|
|
6243 |
-- |
|
6237 | 6244 |
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: |
6238 | 6245 |
-- |
6239 | 6246 |
|
Also available in: Unified diff
schemas/vegbien.sql: location: location_unique_within_parent: Split into *_by_sourceaccessioncode and *_by_authorlocationcode_position, with each ID being matched separately. This way, if the initial import of a subplot's location provides both fields, but fkey references use only one field, the fkey references will still match the existing location because only one of the fields needs to match.