From: Bill Erickson Date: Tue, 19 Jan 2016 15:55:58 +0000 (-0500) Subject: JBAS-944 Add extend_reporter changes for 2.7 upgrade X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bef2acf54aa1df4287ae8540deba783c9a0eba86;p=working%2FEvergreen.git JBAS-944 Add extend_reporter changes for 2.7 upgrade These changes were not included in the version upgrade scripts, since they were optional. We need them locally. Signed-off-by: Bill Erickson --- diff --git a/KCLS/sql/schema/deploy/2.5-to-2.7-upgrade.sql b/KCLS/sql/schema/deploy/2.5-to-2.7-upgrade.sql index f6a8e5fe5c..007091cc00 100644 --- a/KCLS/sql/schema/deploy/2.5-to-2.7-upgrade.sql +++ b/KCLS/sql/schema/deploy/2.5-to-2.7-upgrade.sql @@ -8926,6 +8926,14 @@ UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_li UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '110' AND control_set = 1 AND sf_list ILIKE '%e%'; +-- see note at the bottom of 2.5.3-2.6.0-upgrade-db.sql +CREATE OR REPLACE VIEW extend_reporter.full_circ_count AS + SELECT cp.id, + COALESCE((SELECT circ_count FROM extend_reporter.legacy_circ_count WHERE id = cp.id), 0) + + (SELECT COUNT(*) FROM action.circulation WHERE target_copy = cp.id) + + (SELECT COUNT(*) FROM action.aged_circulation WHERE target_copy = cp.id) AS circ_count + FROM asset.copy cp; + COMMIT;