LP#1569884 Allow deleted monograph parts to be recreated.
authorSteven Callender <stevecallender@esilibrary.com>
Wed, 13 Apr 2016 15:15:27 +0000 (11:15 -0400)
committerSteven Callender <stevecallender@esilibrary.com>
Wed, 27 Apr 2016 16:02:31 +0000 (12:02 -0400)
Changed the constraint on the biblio.monograph_part table to allow for a
monograph part to be created if a duplicate deleted version is found.

Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql [new file with mode: 0644]

diff --git a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
new file mode 100644 (file)
index 0000000..235a5f0
--- /dev/null
@@ -0,0 +1,8 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE biblio.monograph_part DROP CONSTRAINT "record_label_unique";
+CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
+
+COMMIT;