BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0592', :eg_version); -- mrperters-isl/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0594', :eg_version); -- phasefx/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
--- /dev/null
+-- Evergreen DB patch XXXX.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql
+--
+-- New org setting circ.offline.skip_checkout_if_newer_status_changed_time
+-- New org setting circ.offline.skip_renew_if_newer_status_changed_time
+-- New org setting circ.offline.skip_checkin_if_newer_status_changed_time
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0593', :eg_version);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'circ.offline.skip_checkout_if_newer_status_changed_time',
+ oils_i18n_gettext(
+ 'circ.offline.skip_checkout_if_newer_status_changed_time',
+ 'Offline: Skip offline checkout if newer item Status Changed Time.',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.offline.skip_checkout_if_newer_status_changed_time',
+ 'Skip offline checkout transaction (raise exception when'
+ || ' processing) if item Status Changed Time is newer than the'
+ || ' recorded transaction time. WARNING: The Reshelving to'
+ || ' Available status rollover will trigger this.',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ ),(
+ 'circ.offline.skip_renew_if_newer_status_changed_time',
+ oils_i18n_gettext(
+ 'circ.offline.skip_renew_if_newer_status_changed_time',
+ 'Offline: Skip offline renewal if newer item Status Changed Time.',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.offline.skip_renew_if_newer_status_changed_time',
+ 'Skip offline renewal transaction (raise exception when'
+ || ' processing) if item Status Changed Time is newer than the'
+ || ' recorded transaction time. WARNING: The Reshelving to'
+ || ' Available status rollover will trigger this.',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ ),(
+ 'circ.offline.skip_checkin_if_newer_status_changed_time',
+ oils_i18n_gettext(
+ 'circ.offline.skip_checkin_if_newer_status_changed_time',
+ 'Offline: Skip offline checkin if newer item Status Changed Time.',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.offline.skip_checkin_if_newer_status_changed_time',
+ 'Skip offline checkin transaction (raise exception when'
+ || ' processing) if item Status Changed Time is newer than the'
+ || ' recorded transaction time. WARNING: The Reshelving to'
+ || ' Available status rollover will trigger this.',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ );
+
+COMMIT;
--- /dev/null
+-- Evergreen DB patch YYYY.schema.acp_status_date_changed.sql
+--
+-- Change trigger which updates copy status_changed_time to ignore the
+-- Reshelving->Available status rollover
+-BEGIN;
+
+-- FIXME: 0039.schema.acp_status_date_changed.sql defines this the first time
+-- around, but along with the column itself, etc. And it gets modified with
+-- 0562.schema.copy_active_date.sql. Not sure how to use the supercedes /
+-- deprecate stuff for upgrade scripts, if it's even applicable when a given
+-- upgrade script is doing so much.
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0594', :eg_version);
+
+CREATE OR REPLACE FUNCTION asset.acp_status_changed()
+RETURNS TRIGGER AS $$
+BEGIN
+ IF NEW.status <> OLD.status AND NOT (NEW.status = 0 AND OLD.status = 7) THEN
+ NEW.status_changed_time := now();
+ IF NEW.active_date IS NULL AND NEW.status IN (SELECT id FROM config.copy_status WHERE copy_active = true) THEN
+ NEW.active_date := now();
+ END IF;
+ END IF;
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+COMMIT;
+++ /dev/null
--- Evergreen DB patch XXXX.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql
---
--- New org setting circ.offline.skip_checkout_if_newer_status_changed_time
--- New org setting circ.offline.skip_renew_if_newer_status_changed_time
--- New org setting circ.offline.skip_checkin_if_newer_status_changed_time
---
-BEGIN;
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
- VALUES (
- 'circ.offline.skip_checkout_if_newer_status_changed_time',
- oils_i18n_gettext(
- 'circ.offline.skip_checkout_if_newer_status_changed_time',
- 'Offline: Skip offline checkout if newer item Status Changed Time.',
- 'coust',
- 'label'
- ),
- oils_i18n_gettext(
- 'circ.offline.skip_checkout_if_newer_status_changed_time',
- 'Skip offline checkout transaction (raise exception when'
- || ' processing) if item Status Changed Time is newer than the'
- || ' recorded transaction time. WARNING: The Reshelving to'
- || ' Available status rollover will trigger this.',
- 'coust',
- 'description'
- ),
- 'bool'
- ),(
- 'circ.offline.skip_renew_if_newer_status_changed_time',
- oils_i18n_gettext(
- 'circ.offline.skip_renew_if_newer_status_changed_time',
- 'Offline: Skip offline renewal if newer item Status Changed Time.',
- 'coust',
- 'label'
- ),
- oils_i18n_gettext(
- 'circ.offline.skip_renew_if_newer_status_changed_time',
- 'Skip offline renewal transaction (raise exception when'
- || ' processing) if item Status Changed Time is newer than the'
- || ' recorded transaction time. WARNING: The Reshelving to'
- || ' Available status rollover will trigger this.',
- 'coust',
- 'description'
- ),
- 'bool'
- ),(
- 'circ.offline.skip_checkin_if_newer_status_changed_time',
- oils_i18n_gettext(
- 'circ.offline.skip_checkin_if_newer_status_changed_time',
- 'Offline: Skip offline checkin if newer item Status Changed Time.',
- 'coust',
- 'label'
- ),
- oils_i18n_gettext(
- 'circ.offline.skip_checkin_if_newer_status_changed_time',
- 'Skip offline checkin transaction (raise exception when'
- || ' processing) if item Status Changed Time is newer than the'
- || ' recorded transaction time. WARNING: The Reshelving to'
- || ' Available status rollover will trigger this.',
- 'coust',
- 'description'
- ),
- 'bool'
- );
-
-COMMIT;
+++ /dev/null
--- Evergreen DB patch YYYY.schema.acp_status_date_changed.sql
---
--- Change trigger which updates copy status_changed_time to ignore the
--- Reshelving->Available status rollover
--BEGIN;
-
--- FIXME: 0039.schema.acp_status_date_changed.sql defines this the first time
--- around, but along with the column itself, etc. And it gets modified with
--- 0562.schema.copy_active_date.sql. Not sure how to use the supercedes /
--- deprecate stuff for upgrade scripts, if it's even applicable when a given
--- upgrade script is doing so much.
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('YYYY', :eg_version);
-
-CREATE OR REPLACE FUNCTION asset.acp_status_changed()
-RETURNS TRIGGER AS $$
-BEGIN
- IF NEW.status <> OLD.status AND NOT (NEW.status = 0 AND OLD.status = 7) THEN
- NEW.status_changed_time := now();
- IF NEW.active_date IS NULL AND NEW.status IN (SELECT id FROM config.copy_status WHERE copy_active = true) THEN
- NEW.active_date := now();
- END IF;
- END IF;
- RETURN NEW;
-END;
-$$ LANGUAGE plpgsql;
-
-COMMIT;