From d804bc1876c9cc837c87b7cfdc0575f6b488d711 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Thu, 21 Mar 2013 08:02:09 -0400 Subject: [PATCH] disabling copy triggers for faster updates --- .../sql/Pg/version-upgrade/pines-2.1-2.2-upgrade-copy-active.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/sql/Pg/version-upgrade/pines-2.1-2.2-upgrade-copy-active.sql b/Open-ILS/src/sql/Pg/version-upgrade/pines-2.1-2.2-upgrade-copy-active.sql index be5365b118..a3f57731a1 100644 --- a/Open-ILS/src/sql/Pg/version-upgrade/pines-2.1-2.2-upgrade-copy-active.sql +++ b/Open-ILS/src/sql/Pg/version-upgrade/pines-2.1-2.2-upgrade-copy-active.sql @@ -3,6 +3,9 @@ -- Don't require use of -vegversion=something \set eg_version '''2.2.0''' + + + -- Evergreen DB patch 0562.schema.copy_active_date.sql -- -- Active Date @@ -421,6 +424,9 @@ INSERT into config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( 'circ.holds.age_protect.active_date', 'Holds: Use Active Date for Age Protection', 'When calculating age protection rules use the active date instead of the creation date.', 'bool'); +-- Disable copy triggers for faster update +ALTER TABLE asset.copy DISABLE TRIGGER ALL; + -- Assume create date when item is in status we would update active date for anyway UPDATE asset.copy SET active_date = create_date WHERE status IN (SELECT id FROM config.copy_status WHERE copy_active = true); @@ -430,4 +436,5 @@ UPDATE asset.copy SET active_date = create_date WHERE id IN (SELECT id FROM exte -- Assume create date for status change time while we are at it. Because being created WAS a change in status. UPDATE asset.copy SET status_changed_time = create_date WHERE status_changed_time IS NULL; - +-- Re-enable triggers +ALTER TABLE asset.copy ENABLE TRIGGER ALL; -- 2.11.0