1 -- This statement ok to fail if the row is already there in coust. You will
2 -- already have this if you have a
3 -- very old trunk installation (because this has been added by an earlier
4 -- upgrade script (0109), but has not been in the default seed data until
6 INSERT INTO config.org_unit_setting_type
7 (name, label, description, datatype) VALUES (
8 'circ.booking_reservation.default_elbow_room',
10 'circ.booking_reservation.default_elbow_room',
11 'Booking: Elbow room',
16 'circ.booking_reservation.default_elbow_room',
17 'Elbow room specifies how far in the future you must make a reservation on an item if that item will have to transit to reach its pickup location. It secondarily defines how soon a reservation on a given item must start before the check-in process will opportunistically capture it for the reservation shelf.',
26 INSERT INTO config.upgrade_log (version) VALUES ('0323'); -- senator
28 -- In booking, elbow room defines:
29 -- a) how far in the future you must make a reservation on a given item if
30 -- that item will have to transit somewhere to fulfill the reservation.
31 -- b) how soon a reservation must be starting for the reserved item to
32 -- be op-captured by the checkin interface.
34 -- We don't want to clobber any default_elbow room at any level:
36 CREATE OR REPLACE FUNCTION pg_temp.default_elbow() RETURNS INTEGER AS $$
38 existing actor.org_unit_setting%ROWTYPE;
40 SELECT INTO existing id FROM actor.org_unit_setting WHERE name = 'circ.booking_reservation.default_elbow_room';
42 INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES (
43 (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
44 'circ.booking_reservation.default_elbow_room',
53 SELECT pg_temp.default_elbow();