1 -- add missing behind_desk column
5 SELECT evergreen.upgrade_deps_block_check('0868', :eg_version);
7 CREATE OR REPLACE VIEW action.all_hold_request AS
9 COALESCE(a.post_code, b.post_code) AS usr_post_code,
10 p.home_ou AS usr_home_ou,
11 p.profile AS usr_profile,
12 EXTRACT(YEAR FROM p.dob)::INT AS usr_birth_year,
13 CAST(ahr.requestor <> ahr.usr AS BOOLEAN) AS staff_placed,
27 ahr.fulfillment_staff,
36 WHEN ahr.phone_notify IS NULL THEN FALSE
37 WHEN ahr.phone_notify = '' THEN FALSE
42 WHEN ahr.sms_notify IS NULL THEN FALSE
43 WHEN ahr.sms_notify = '' THEN FALSE
51 ahr.shelf_expire_time,
52 ahr.current_shelf_lib,
54 FROM action.hold_request ahr
55 JOIN actor.usr p ON (ahr.usr = p.id)
56 LEFT JOIN actor.usr_address a ON (p.mailing_address = a.id)
57 LEFT JOIN actor.usr_address b ON (p.billing_address = b.id)
97 FROM action.aged_hold_request;
101 CREATE OR REPLACE FUNCTION action.age_hold_on_delete () RETURNS TRIGGER AS $$
104 -- Archive a copy of the old row to action.aged_hold_request
106 INSERT INTO action.aged_hold_request
182 FROM action.all_hold_request WHERE id = OLD.id;
186 $$ LANGUAGE 'plpgsql';