Project

General

Profile

« Previous | Next » 

Revision 3344

schemas/vegbien.sql: specimenreplicate: specimenreplicate_unique_catalognumber UNIQUE INDEX: Limited to rows where sourceaccessioncode IS NULL, so that it will only be used as an alternate if the datasource does not specify a sourceaccessioncode. This should fix the SpeciesLink bug where input rows with catalognumber_dwc IS NULL match multiple output rows when compared on the specimenreplicate_unique_catalognumber UNIQUE INDEX because they were excluded from the uniquifying by the index filter.

View differences:

vegbien.sql
4340 4340
-- Name: specimenreplicate_unique_catalognumber; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4341 4341
--
4342 4342

  
4343
CREATE UNIQUE INDEX specimenreplicate_unique_catalognumber ON specimenreplicate USING btree (datasource_id, (COALESCE(institution_id, 2147483647)), (COALESCE(collectioncode_dwc, '\\N'::text)), (COALESCE(catalognumber_dwc, '\\N'::text))) WHERE (catalognumber_dwc IS NOT NULL);
4343
CREATE UNIQUE INDEX specimenreplicate_unique_catalognumber ON specimenreplicate USING btree (datasource_id, (COALESCE(institution_id, 2147483647)), (COALESCE(collectioncode_dwc, '\\N'::text)), (COALESCE(catalognumber_dwc, '\\N'::text))) WHERE ((catalognumber_dwc IS NOT NULL) AND (sourceaccessioncode IS NULL));
4344 4344

  
4345 4345

  
4346 4346
--

Also available in: Unified diff