From: Mike Rylander Date: Fri, 11 Feb 2011 00:58:35 +0000 (-0500) Subject: merging fun X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b9df29f6a3570823da805ca6fcea84354adcd352;p=evergreen%2Fequinox.git merging fun --- b9df29f6a3570823da805ca6fcea84354adcd352 diff --cc Open-ILS/src/sql/Pg/040.schema.asset.sql index 06cf5f4ad8,cb738963e3..d3efe76671 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@@ -363,7 -363,34 +363,7 @@@ CREATE TABLE asset.copy_template mint_condition BOOL ); - CREATE OR REPLACE FUNCTION asset.opac_ou_record_copy_count (org INT, record BIGINT) RETURNS TABLE (depth INT, org_unit INT, visible BIGINT, available BIGINT, unshadow BIGINT, transcendant INT) AS $f$ -CREATE VIEW stats.fleshed_copy AS - SELECT cp.*, - CAST(cp.create_date AS DATE) AS create_date_day, - CAST(cp.edit_date AS DATE) AS edit_date_day, - DATE_TRUNC('hour', cp.create_date) AS create_date_hour, - DATE_TRUNC('hour', cp.edit_date) AS edit_date_hour, - cn.label AS call_number_label, - cn.owning_lib, - rd.item_lang, - rd.item_type, - rd.item_form - FROM asset.copy cp - JOIN asset.call_number cn ON (cp.call_number = cn.id) - JOIN metabib.rec_descriptor rd ON (rd.record = cn.record); - -CREATE VIEW stats.fleshed_call_number AS - SELECT cn.*, - CAST(cn.create_date AS DATE) AS create_date_day, - CAST(cn.edit_date AS DATE) AS edit_date_day, - DATE_TRUNC('hour', cn.create_date) AS create_date_hour, - DATE_TRUNC('hour', cn.edit_date) AS edit_date_hour, - rd.item_lang, - rd.item_type, - rd.item_form - FROM asset.call_number cn - JOIN metabib.rec_descriptor rd ON (rd.record = cn.record); - + CREATE OR REPLACE FUNCTION asset.opac_ou_record_copy_count (org INT, rid BIGINT) RETURNS TABLE (depth INT, org_unit INT, visible BIGINT, available BIGINT, unshadow BIGINT, transcendant INT) AS $f$ DECLARE ans RECORD; trans INT;