Project

General

Profile

« Previous | Next » 

Revision 3178

schemas/vegbien.sql: specimenreplicate: UNIQUE INDEX on catalognumber_dwc: Added institution_id so that datasources that specify it (such as aggregators) will not need to have catalognumbers be globally unique. Once the institution_id is mapped to, this will fix a bug where rows with the same catalognumber were assumed to be duplicates even though they were from different institutions. This should also avoid the need to do any duplicate elimination joins when importing specimenreplicate, speeding up column-based import.

View differences:

schemas/vegbien.sql
5231 5231
-- Name: specimenreplicate_unique_catalognumber; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5232 5232
--
5233 5233

  
5234
CREATE UNIQUE INDEX specimenreplicate_unique_catalognumber ON specimenreplicate USING btree (datasource_id, catalognumber_dwc) WHERE (sourceaccessioncode IS NULL);
5234
CREATE UNIQUE INDEX specimenreplicate_unique_catalognumber ON specimenreplicate USING btree (datasource_id, (COALESCE(institution_id, 2147483647)), catalognumber_dwc) WHERE (sourceaccessioncode IS NULL);
5235 5235

  
5236 5236

  
5237 5237
--

Also available in: Unified diff