Project

General

Profile

« Previous | Next » 

Revision 585

vegbien.sql: Changed taxonbinmethod_keys to UNIQUE INDEX to take advantage of COALESCE for dealing with NULL values

View differences:

schemas/vegbien.sql
2491 2491

  
2492 2492
CREATE TABLE taxonbinmethod (
2493 2493
    taxonbinmethod_id integer NOT NULL,
2494
    label character varying(255) DEFAULT ''::character varying NOT NULL,
2494
    label character varying(255),
2495 2495
    stratum_id integer,
2496 2496
    sizeclass_id integer,
2497 2497
    coverindex_id integer,
......
4418 4418

  
4419 4419

  
4420 4420
--
4421
-- Name: taxonbinmethod_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4422
--
4423

  
4424
ALTER TABLE ONLY taxonbinmethod
4425
    ADD CONSTRAINT taxonbinmethod_keys UNIQUE (label, stratum_id, sizeclass_id, coverindex_id);
4426

  
4427

  
4428
--
4429 4421
-- Name: taxonbinmethod_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4430 4422
--
4431 4423

  
......
5588 5580

  
5589 5581

  
5590 5582
--
5583
-- Name: taxonbinmethod_keys; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5584
--
5585

  
5586
CREATE UNIQUE INDEX taxonbinmethod_keys ON taxonbinmethod USING btree ((COALESCE(label, ''::character varying)), stratum_id, sizeclass_id, coverindex_id);
5587

  
5588

  
5589
--
5591 5590
-- Name: taxondetermination_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5592 5591
--
5593 5592

  

Also available in: Unified diff