Stamped upgrade scripts for LP#797409
authorMike Rylander <mrylander@gmail.com>
Tue, 9 Aug 2011 17:26:17 +0000 (13:26 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 9 Aug 2011 17:26:17 +0000 (13:26 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0593.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/0594.schema.acp_status_date_changed.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql [deleted file]
Open-ILS/src/sql/Pg/upgrade/YYYY.schema.acp_status_date_changed.sql [deleted file]

index 950947e..a8c2e9f 100644 (file)
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     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,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0593.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql b/Open-ILS/src/sql/Pg/upgrade/0593.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql
new file mode 100644 (file)
index 0000000..d8a121d
--- /dev/null
@@ -0,0 +1,69 @@
+-- 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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/0594.schema.acp_status_date_changed.sql b/Open-ILS/src/sql/Pg/upgrade/0594.schema.acp_status_date_changed.sql
new file mode 100644 (file)
index 0000000..c55abd8
--- /dev/null
@@ -0,0 +1,29 @@
+-- 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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-circ.offline.skip_foo_if_newer_status_changed_time.sql
deleted file mode 100644 (file)
index 0a68459..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
--- 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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.acp_status_date_changed.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.acp_status_date_changed.sql
deleted file mode 100644 (file)
index 34715d1..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
--- 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;