From 61bac8464b6d65232e5a570b925318d80166e132 Mon Sep 17 00:00:00 2001 From: Steven Callender Date: Wed, 13 Apr 2016 11:15:27 -0400 Subject: [PATCH] LP#1569884 Allow deleted monograph parts to be recreated. 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. To test: [1] Add a monograph part to a bib. [2] Delete that monograph part. [3] Attempt to add a monograph part to the same bib using the same part label. Without the patches installed, this will fail; upon applying the database update, this operation should succeed. Signed-off-by: Steven Callender Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- .../src/sql/XXXX.schema.allow_parts_to_be_recreated.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql 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 index 0000000000..235a5f0cb0 --- /dev/null +++ b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql @@ -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; -- 2.43.2