From d2c8443068061879747750df023ff7cf4631425d Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 9 Aug 2017 08:50:41 -0400 Subject: [PATCH] LP#1145213: improvements to record merge This patch checks for suffix and prefix of call number before merging assets and ensures that unused call number records are marked deleted. To test: [0] Apply the patch. [1] Attempt a record merge where each record has a volumes with the same call number label and owning library but different affixes. Verify that the volumes and their associated copies are not merged onto the same volume.. [2] Attempt a merge with records having matching volumes. Verify that the copies are moved to one volume and that the other is marked deleted. Signed-off-by: Rogan Hamby Signed-off-by: Cesar Velez Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/999.functions.global.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql index a42bf69ab3..dc72926ab1 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -1061,6 +1061,8 @@ BEGIN SELECT INTO target_cn * FROM asset.call_number WHERE label = source_cn.label + AND prefix = source_cn.prefix + AND suffix = source_cn.suffix AND owning_lib = source_cn.owning_lib AND record = target_record AND NOT deleted; @@ -1082,6 +1084,8 @@ BEGIN moved_objects := moved_objects + 1; END LOOP; + + UPDATE asset.call_number SET deleted = TRUE WHERE id = source_cn.id; -- ... if not ... ELSE -- 2.11.0