[open-ils-commits] r18028 - in branches/rel_2_0/Open-ILS/src/sql/Pg: . upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Sep 27 12:15:55 EDT 2010
Author: miker
Date: 2010-09-27 12:15:52 -0400 (Mon, 27 Sep 2010)
New Revision: 18028
Added:
branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0419.schema.hold_record_view.sql
Modified:
branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
branches/rel_2_0/Open-ILS/src/sql/Pg/reporter-schema.sql
Log:
Backport r18027 from trunk: Adjust hold-to-record view to cover I, F and R hold types
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-27 16:15:14 UTC (rev 18027)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-27 16:15:52 UTC (rev 18028)
@@ -70,7 +70,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0418'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0419'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/reporter-schema.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/reporter-schema.sql 2010-09-27 16:15:14 UTC (rev 18027)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/reporter-schema.sql 2010-09-27 16:15:52 UTC (rev 18028)
@@ -305,9 +305,11 @@
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 = 'C'
+ 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)
Copied: branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0419.schema.hold_record_view.sql (from rev 18027, trunk/Open-ILS/src/sql/Pg/upgrade/0419.schema.hold_record_view.sql)
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0419.schema.hold_record_view.sql (rev 0)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0419.schema.hold_record_view.sql 2010-09-27 16:15:52 UTC (rev 18028)
@@ -0,0 +1,23 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0419'); -- miker
+
+CREATE OR REPLACE VIEW reporter.hold_request_record AS
+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)
+ END AS bib_record
+ FROM action.hold_request ahr;
+
+COMMIT;
More information about the open-ils-commits
mailing list