[open-ils-commits] [GIT] Evergreen ILS branch master updated. cbe4caec19cabfc4696b433cd63389ff4447e335

Evergreen Git git at git.evergreen-ils.org
Wed Jan 25 11:29:17 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  cbe4caec19cabfc4696b433cd63389ff4447e335 (commit)
      from  72df5dc92ef547e065f3a10f318d265236f3d220 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cbe4caec19cabfc4696b433cd63389ff4447e335
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Jan 18 14:38:00 2017 -0500

    LP#1657237: Rewrite the hold target cache
    
    We fixed the trigger that caused the problem in bug 167237, but now we need
    to rewrite reporter.hold_request_record because T-holds are probably all
    wrong.  No data was lost, we're just addressing the contents of a materialized
    view.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Jason Boyer <jboyer at library.in.gov>

diff --git a/Open-ILS/src/sql/Pg/upgrade/1004.function.hold-move-trigger-bug.sql b/Open-ILS/src/sql/Pg/upgrade/1004.function.hold-move-trigger-bug.sql
index 1e3dfd1..5a773af 100644
--- a/Open-ILS/src/sql/Pg/upgrade/1004.function.hold-move-trigger-bug.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1004.function.hold-move-trigger-bug.sql
@@ -47,5 +47,31 @@ BEGIN
 END;
 $$ LANGUAGE PLPGSQL;
 
+TRUNCATE TABLE reporter.hold_request_record;
+ 
+INSERT INTO reporter.hold_request_record 
+SELECT  id,
+        target,
+        hold_type,
+        CASE
+                WHEN hold_type = 'T'
+                        THEN target
+                WHEN hold_type = 'I'
+                        THEN (SELECT ssub.record_entry FROM serial.subscription ssub JOIN serial.issuance si ON (si.subscription = ssub.id) WHERE si.id = ahr.target)
+                WHEN hold_type = 'V'
+                        THEN (SELECT cn.record FROM asset.call_number cn WHERE cn.id = ahr.target)
+                WHEN hold_type IN ('C','R','F')
+                        THEN (SELECT cn.record FROM asset.call_number cn JOIN asset.copy cp ON (cn.id = cp.call_number) WHERE cp.id = ahr.target)
+                WHEN hold_type = 'M'
+                        THEN (SELECT mr.master_record FROM metabib.metarecord mr WHERE mr.id = ahr.target)
+                WHEN hold_type = 'P'
+                        THEN (SELECT bmp.record FROM biblio.monograph_part bmp WHERE bmp.id = ahr.target)
+        END AS bib_record
+  FROM  action.hold_request ahr;
+ 
+REINDEX TABLE reporter.hold_request_record;
+
 COMMIT;
 
+ANALYZE reporter.hold_request_record;
+

-----------------------------------------------------------------------

Summary of changes:
 .../1004.function.hold-move-trigger-bug.sql        |   26 ++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list