<field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
<field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
<field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
+ <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
</fields>
<links>
<link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
<field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
<field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
<field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
+ <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
</fields>
<links>
<link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
<field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
<field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
<field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
+ <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
</fields>
<links>
<link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
cut_in_line BOOL,
mint_condition BOOL NOT NULL DEFAULT TRUE,
shelf_expire_time TIMESTAMPTZ,
- current_shelf_lib INT REFERENCES actor.org_unit DEFERRABLE INITIALLY DEFERRED
+ current_shelf_lib INT REFERENCES actor.org_unit DEFERRABLE INITIALLY DEFERRED,
+ behind_desk BOOLEAN NOT NULL DEFAULT FALSE
);
ALTER TABLE action.hold_request ADD CONSTRAINT sms_check CHECK (
sms_notify IS NULL
--- /dev/null
+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;