LP#1569884 Updated base schema with monograph parts index. collab/Callender/monograph_parts_new_constraints_index_with_signoff
authorSteven Callender <stevecallender@esilibrary.com>
Wed, 27 Apr 2016 16:05:48 +0000 (12:05 -0400)
committerSteven Callender <stevecallender@esilibrary.com>
Wed, 27 Apr 2016 16:05:48 +0000 (12:05 -0400)
Signed-off-by: Steven Callender <stevecallender@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