break out holding code into materialized view
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 27 Feb 2012 20:15:10 +0000 (15:15 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 7 Mar 2012 21:57:09 +0000 (16:57 -0500)
commitf997e0122a903e382889fbdedec3029fc581405a
treebb78ea8ecd406f939fa2f5aa4544caa8c8cf711d
parent6e2fc28ae6d47255265902254f988a1746824e51
break out holding code into materialized view

otherwise it's really awkward to get at the information in the
json-encoded array stored in a single column that hols the holding code,
which we must break apart to build a year->month->day tree or a
v.->no.->iss. tree or whatever.

example sql to help me remember where I'm going (not a final version of
anything):

-- if nothing expanded:
select
    sdist.display_grouping,
    siss.id,
    siss.label,
    smhc.value
from serial.basic_summary sbsum
join serial.distribution sdist on (sdist.id = sbsum.distribution)
join serial.stream sstr on (sstr.distribution = sdist.id)
join serial.item sitem on (sitem.stream = sstr.id)
join serial.issuance siss on (siss.id = sitem.issuance)
join serial.materialized_holding_code smhc on (smhc.issuance = siss.id)
where smhc.subfield = 'i';

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.serial-holding-groups.sql