[open-ils-commits] [GIT] Evergreen ILS branch rel_2_11 updated. 25d4b1833277e8564496396dd135aae2ef2bed72
Evergreen Git
git at git.evergreen-ils.org
Wed Feb 15 17:28:01 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, rel_2_11 has been updated
via 25d4b1833277e8564496396dd135aae2ef2bed72 (commit)
from c8bcead5867c64fc1e03cf16f03ff8e6773913d0 (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 25d4b1833277e8564496396dd135aae2ef2bed72
Author: Dan Wells <dbw2 at calvin.edu>
Date: Wed Feb 15 17:25:49 2017 -0500
Forward-port 2.11.2 Upgrade Script
Signed-off-by: Dan Wells <dbw2 at calvin.edu>
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.11.1-2.11.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.11.1-2.11.2-upgrade-db.sql
new file mode 100644
index 0000000..e7cadc4
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.11.1-2.11.2-upgrade-db.sql
@@ -0,0 +1,85 @@
+--Upgrade Script for 2.11.1 to 2.11.2
+\set eg_version '''2.11.2'''
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.11.2', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('1004', :eg_version);
+
+CREATE OR REPLACE FUNCTION reporter.hold_request_record_mapper () RETURNS TRIGGER AS $$
+BEGIN
+ IF TG_OP = 'INSERT' THEN
+ INSERT INTO reporter.hold_request_record (id, target, hold_type, bib_record)
+ SELECT NEW.id,
+ NEW.target,
+ NEW.hold_type,
+ CASE
+ WHEN NEW.hold_type = 'T'
+ THEN NEW.target
+ WHEN NEW.hold_type = 'I'
+ THEN (SELECT ssub.record_entry FROM serial.subscription ssub JOIN serial.issuance si ON (si.subscription = ssub.id) WHERE si.id = NEW.target)
+ WHEN NEW.hold_type = 'V'
+ THEN (SELECT cn.record FROM asset.call_number cn WHERE cn.id = NEW.target)
+ WHEN NEW.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 = NEW.target)
+ WHEN NEW.hold_type = 'M'
+ THEN (SELECT mr.master_record FROM metabib.metarecord mr WHERE mr.id = NEW.target)
+ WHEN NEW.hold_type = 'P'
+ THEN (SELECT bmp.record FROM biblio.monograph_part bmp WHERE bmp.id = NEW.target)
+ END AS bib_record;
+ ELSIF TG_OP = 'UPDATE' AND (OLD.target <> NEW.target OR OLD.hold_type <> NEW.hold_type) THEN
+ UPDATE reporter.hold_request_record
+ SET target = NEW.target,
+ hold_type = NEW.hold_type,
+ bib_record = CASE
+ WHEN NEW.hold_type = 'T'
+ THEN NEW.target
+ WHEN NEW.hold_type = 'I'
+ THEN (SELECT ssub.record_entry FROM serial.subscription ssub JOIN serial.issuance si ON (si.subscription = ssub.id) WHERE si.id = NEW.target)
+ WHEN NEW.hold_type = 'V'
+ THEN (SELECT cn.record FROM asset.call_number cn WHERE cn.id = NEW.target)
+ WHEN NEW.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 = NEW.target)
+ WHEN NEW.hold_type = 'M'
+ THEN (SELECT mr.master_record FROM metabib.metarecord mr WHERE mr.id = NEW.target)
+ WHEN NEW.hold_type = 'P'
+ THEN (SELECT bmp.record FROM biblio.monograph_part bmp WHERE bmp.id = NEW.target)
+ END
+ WHERE id = NEW.id;
+ END IF;
+ RETURN NEW;
+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;
+
+
+ANALYZE reporter.hold_request_record;
+
+
+SELECT evergreen.upgrade_deps_block_check('1005', :eg_version);
+
+CREATE INDEX action_aged_circulation_parent_circ_idx ON action.aged_circulation (parent_circ);
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
.../2.11.1-2.11.2-upgrade-db.sql} | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
copy Open-ILS/src/sql/Pg/{upgrade/1004.function.hold-move-trigger-bug.sql => version-upgrade/2.11.1-2.11.2-upgrade-db.sql} (92%)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list