From 537327fb0912149c142fcc1c8b5ead759e5a0d6c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 13 Oct 2016 15:53:49 -0400 Subject: [PATCH] JBAS-1554 Apply 1 year circ purge config Also avoid overwriting the config within the nightly purge script. That's confusing. Signed-off-by: Bill Erickson --- KCLS/sql/schema/deploy/patron-co-history-stage-2.sql | 6 ++++++ KCLS/utility-scripts/purge_circs/purge_circulations.psql | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/KCLS/sql/schema/deploy/patron-co-history-stage-2.sql b/KCLS/sql/schema/deploy/patron-co-history-stage-2.sql index 9145a0157a..5ad499653b 100644 --- a/KCLS/sql/schema/deploy/patron-co-history-stage-2.sql +++ b/KCLS/sql/schema/deploy/patron-co-history-stage-2.sql @@ -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); diff --git a/KCLS/utility-scripts/purge_circs/purge_circulations.psql b/KCLS/utility-scripts/purge_circs/purge_circulations.psql index e56e4c51f9..5bc4fb9342 100644 --- a/KCLS/utility-scripts/purge_circs/purge_circulations.psql +++ b/KCLS/utility-scripts/purge_circs/purge_circulations.psql @@ -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; -- 2.11.0