From ca2bd747070d0f8e367033ae4a09a7d5c2443693 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 9 Aug 2017 08:50:41 -0400 Subject: [PATCH] checks for suffix and prefix of call number before merging assets and removes unused call numbers --- 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 612a4ba3c2..512427c2a6 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -1060,6 +1060,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; @@ -1081,6 +1083,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