LP#1569884 Updated base schema with monograph parts index.
authorSteven Callender <stevecallender@esilibrary.com>
Wed, 27 Apr 2016 16:05:48 +0000 (12:05 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 28 Apr 2016 15:24:19 +0000 (11:24 -0400)
Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlcstaff.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/010.schema.biblio.sql

index ff0542d..3312edf 100644 (file)
@@ -99,8 +99,8 @@ CREATE TABLE biblio.monograph_part (
     label           TEXT    NOT NULL,
     label_sortkey   TEXT    NOT NULL,
     deleted         BOOL    NOT NULL DEFAULT FALSE,
-    CONSTRAINT record_label_unique UNIQUE (record,label)
 );
+CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
 
 CREATE OR REPLACE FUNCTION biblio.normalize_biblio_monograph_part_sortkey () RETURNS TRIGGER AS $$
 BEGIN