From 1de8cee943b7a201bac05fbfa31e2b819de41def Mon Sep 17 00:00:00 2001 From: Doug Kyle Date: Mon, 14 Apr 2014 09:58:11 -0400 Subject: [PATCH] Function for storing daily capacity data Function intended to be run from cron, cap store data for monitoring and reporting on floating collecttions. Signed-off-by: Doug Kyle --- Open-ILS/src/sql/Pg/smart_float.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Open-ILS/src/sql/Pg/smart_float.sql b/Open-ILS/src/sql/Pg/smart_float.sql index eaa08d3fa6..e64dc881db 100644 --- a/Open-ILS/src/sql/Pg/smart_float.sql +++ b/Open-ILS/src/sql/Pg/smart_float.sql @@ -260,5 +260,16 @@ BEGIN END IF; END; +-- !!! smart_float.add2_cap_store !!! +CREATE OR REPLACE FUNCTION smart_float.add2_cap_store() + -- run nightly to populate cap_store table + RETURNS void + LANGUAGE plpgsql +AS $function$ +BEGIN + insert into smart_float.cap_store (branch,taken,allowed,open,percent_capacity,name,shelf_loc,cap_date) select sfcap.*,date(now()) from grpl.smart_float_capacities() sfcap; +END; +$function$; + -- !!! need some new indexes create index concurrently cp_location_idx on asset.copy (location); -- 2.11.0