LP#1182519 Stamping DB upgrade 0822 user/berick/lp1182519-hold-behind-desk-staging
authorBill Erickson <berick@esilibrary.com>
Fri, 23 Aug 2013 14:35:12 +0000 (10:35 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 23 Aug 2013 15:41:14 +0000 (11:41 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/sql/Pg/upgrade/0822.schema.per-hold-behind-desk.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.per-hold-behind-desk.sql [deleted file]

diff --git a/Open-ILS/src/sql/Pg/upgrade/0822.schema.per-hold-behind-desk.sql b/Open-ILS/src/sql/Pg/upgrade/0822.schema.per-hold-behind-desk.sql
new file mode 100644 (file)
index 0000000..4d6150b
--- /dev/null
@@ -0,0 +1,31 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0822', :eg_version);
+
+ALTER TABLE action.hold_request 
+    ADD COLUMN behind_desk BOOLEAN NOT NULL DEFAULT FALSE;
+
+-- The value on the hold is the new arbiter of whether a 
+-- hold should be held behind the desk and reported as such
+-- Update existing holds that would in the current regime
+-- be considered behind-the-desk holds to use the new column
+
+UPDATE action.hold_request ahr
+    SET behind_desk = TRUE
+    FROM actor.usr_setting aus
+    WHERE 
+        ahr.cancel_time IS NULL AND
+        ahr.fulfillment_time IS NULL AND
+        aus.usr = ahr.usr AND
+        aus.name = 'circ.holds_behind_desk' AND
+        aus.value = 'true' AND
+        EXISTS (
+            SELECT 1 
+            FROM actor.org_unit_ancestor_setting(
+                'circ.holds.behind_desk_pickup_supported', 
+                ahr.pickup_lib
+            ) 
+            WHERE value = 'true'
+        );
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.per-hold-behind-desk.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.per-hold-behind-desk.sql
deleted file mode 100644 (file)
index 4f0458c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-BEGIN;
-
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-ALTER TABLE action.hold_request 
-    ADD COLUMN behind_desk BOOLEAN NOT NULL DEFAULT FALSE;
-
--- The value on the hold is the new arbiter of whether a 
--- hold should be held behind the desk and reported as such
--- Update existing holds that would in the current regime
--- be considered behind-the-desk holds to use the new column
-
-UPDATE action.hold_request ahr
-    SET behind_desk = TRUE
-    FROM actor.usr_setting aus
-    WHERE 
-        ahr.cancel_time IS NULL AND
-        ahr.fulfillment_time IS NULL AND
-        aus.usr = ahr.usr AND
-        aus.name = 'circ.holds_behind_desk' AND
-        aus.value = 'true' AND
-        EXISTS (
-            SELECT 1 
-            FROM actor.org_unit_ancestor_setting(
-                'circ.holds.behind_desk_pickup_supported', 
-                ahr.pickup_lib
-            ) 
-            WHERE value = 'true'
-        );
-
-COMMIT;