]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0274.data.org-setting-type-est-wait.sql
LP#1806968 Teach Vandelay to pass correct auth tracker type
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0274.data.org-setting-type-est-wait.sql
1 BEGIN;
2
3 INSERT INTO config.upgrade_log (version) VALUES ('0274'); -- Scott McKellar
4
5 UPDATE config.org_unit_setting_type SET
6         name = 'circ.holds.default_estimated_wait_interval',
7         label = 'Holds: Default Estimated Wait',
8         description = 'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the default estimated length of time to assume an item will be checked out.',
9         datatype = 'interval'
10 WHERE name = 'circ.hold_estimate_wait_interval';
11
12 UPDATE actor.org_unit_setting SET
13         name = 'circ.holds.default_estimated_wait_interval',
14         --
15         -- The value column should be JSON.  The old value should be a number,
16         -- but it may or may not be quoted.  The following CASE behaves
17         -- differently depending on whether value is quoted.  It is simplistic,
18         -- and will be defeated by leading or trailing white space, or various
19         -- malformations.
20         --
21         value = CASE WHEN SUBSTR( value, 1, 1 ) = '"'
22                                 THEN '"' || SUBSTR( value, 2, LENGTH(value) - 2 ) || ' days"'
23                                 ELSE '"' || value || ' days"'
24                         END
25 WHERE name = 'circ.hold_estimate_wait_interval';
26
27 INSERT INTO config.org_unit_setting_type (
28         name,
29         label,
30         description,
31         datatype
32 ) VALUES (
33         'circ.holds.min_estimated_wait_interval',
34         'Holds: Minimum Estimated Wait',
35         'When predicting the amount of time a patron will be waiting for a hold to be fulfilled, this is the minimum estimated length of time to assume an item will be checked out.',
36         'interval'
37 );
38
39 COMMIT;