Project

General

Profile

« Previous | Next » 

Revision 7013

schemas/vegbien.sql: location: location_unique_within_parent: Also apply this constraint when sourceaccessioncode is provided, because it may be a concatenated value populated for use by the analytical DB but which is not used as an fkey by the datasource itself

View differences:

schemas/vegbien.sql
6230 6230
-- Name: location_unique_within_parent; 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(authorlocationcode, '\N'::text)), (COALESCE(sublocationxposition_m, 'NaN'::double precision)), (COALESCE(sublocationyposition_m, 'NaN'::double precision))) WHERE ((parent_id IS NOT NULL) AND (sourceaccessioncode IS NULL));
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);
6234 6234

  
6235 6235

  
6236 6236
--

Also available in: Unified diff