From: Bill Erickson Date: Fri, 23 Aug 2013 14:35:12 +0000 (-0400) Subject: LP#1182519 Stamping DB upgrade 0822 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f9a2646c51ad3b71c3af0dd422dd0ab32bd5f363;p=Evergreen.git LP#1182519 Stamping DB upgrade 0822 Signed-off-by: Bill Erickson --- 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 index 0000000000..4d6150b39f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0822.schema.per-hold-behind-desk.sql @@ -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 index 4f0458cb0a..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.per-hold-behind-desk.sql +++ /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;