JBAS-1554 Apply 1 year circ purge config
authorBill Erickson <berickxx@gmail.com>
Thu, 13 Oct 2016 19:53:49 +0000 (15:53 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Also avoid overwriting the config within the nightly purge script.
That's confusing.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/sql/schema/deploy/patron-co-history-stage-2.sql
KCLS/utility-scripts/purge_circs/purge_circulations.psql

index 9145a01..5ad4996 100644 (file)
@@ -5,6 +5,12 @@ BEGIN;
 
 SET STATEMENT_TIMEOUT = 0;
 
+-- apply the new circ retention age
+-- add 1 day to account for any variation in purge run time.
+UPDATE config.global_flag 
+    SET value = '1 year 1 day', enabled = TRUE  
+    WHERE name = 'history.circ.retention_age';
+
 \set eg_version '''2.7.8'''
 SELECT evergreen.upgrade_deps_block_check('0960', :eg_version);
 
index e56e4c5..5bc4fb9 100644 (file)
@@ -4,11 +4,6 @@ begin;
 \set ON_ERROR_STOP on
 set client_min_messages = 'notice';
 set statement_timeout = 0;
-
-update config.global_flag set value = '0', enabled = true  where name = 'history.circ.retention_count';
-update config.global_flag set value = '6 months',   enabled = true  where name = 'history.circ.retention_age';
-update config.global_flag set              enabled = true  where name = 'history.circ.retention_uses_last_finished';
-update config.global_flag set              enabled = true  where name = 'history.circ.retention_age_is_min';
 \pset tuples_only on
-select action.purge_circulations_custom(:ts_start,:ts_end);
+select action.purge_circulations_custom(:ts_start, :ts_end);
 commit;