3 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
7 CREATE OR REPLACE VIEW action.all_circulation_combined_types AS
13 ac_acirc.circ_modifier AS item_type,
14 'regular_circ'::text AS circ_type
15 FROM action.circulation acirc,
17 WHERE acirc.target_copy = ac_acirc.id
19 SELECT ancc.id::BIGINT AS id,
20 ancc.circ_time AS xact_start,
22 ancc.staff AS circ_staff,
23 ancc.circ_time AS create_time,
24 cnct_ancc.name AS item_type,
25 'non-cat_circ'::text AS circ_type
26 FROM action.non_cataloged_circulation ancc,
27 config.non_cataloged_type cnct_ancc
28 WHERE ancc.item_type = cnct_ancc.id
30 SELECT aihu.id::BIGINT AS id,
31 aihu.use_time AS xact_start,
32 aihu.org_unit AS circ_lib,
33 aihu.staff AS circ_staff,
34 aihu.use_time AS create_time,
35 ac_aihu.circ_modifier AS item_type,
36 'in-house_use'::text AS circ_type
37 FROM action.in_house_use aihu,
39 WHERE aihu.item = ac_aihu.id
41 SELECT ancihu.id::BIGINT AS id,
42 ancihu.use_time AS xact_start,
43 ancihu.org_unit AS circ_lib,
44 ancihu.staff AS circ_staff,
45 ancihu.use_time AS create_time,
46 cnct_ancihu.name AS item_type,
47 'non-cat-in-house_use'::text AS circ_type
48 FROM action.non_cat_in_house_use ancihu,
49 config.non_cataloged_type cnct_ancihu
50 WHERE ancihu.item_type = cnct_ancihu.id
52 SELECT aacirc.id AS id,
57 ac_aacirc.circ_modifier AS item_type,
58 'aged_circ'::text AS circ_type
59 FROM action.aged_circulation aacirc,
61 WHERE aacirc.target_copy = ac_aacirc.id;
65 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
67 'eg.staffcat.exclude_electronic', 'gui', 'bool',
69 'eg.staffcat.exclude_electronic',
70 'Staff Catalog "Exclude Electronic Resources" Option',
75 FROM config.workstation_setting_type
76 WHERE name = 'eg.staffcat.exclude_electronic'
81 INSERT INTO permission.perm_list ( id, code, description ) SELECT
82 625, 'VIEW_BOOKING_RESERVATION', oils_i18n_gettext(625,
83 'View booking reservations', 'ppl', 'description')
86 FROM permission.perm_list
88 AND code = 'VIEW_BOOKING_RESERVATION'
91 INSERT INTO permission.perm_list ( id, code, description ) SELECT
92 626, 'VIEW_BOOKING_RESERVATION_ATTR_MAP', oils_i18n_gettext(626,
93 'View booking reservation attribute maps', 'ppl', 'description')
96 FROM permission.perm_list
98 AND code = 'VIEW_BOOKING_RESERVATION_ATTR_MAP'
101 -- reprise 1269 just in case now that the perms should definitely exist
106 WHERE code IN ('VIEW_BOOKING_RESERVATION', 'VIEW_BOOKING_RESERVATION_ATTR_MAP'))
108 INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
109 SELECT grp, perms_to_add.id as perm, depth, grantable
111 permission.grp_perm_map
113 --- Don't add the permissions if they have already been assigned
115 (SELECT DISTINCT grp FROM permission.grp_perm_map
116 INNER JOIN perms_to_add ON perm=perms_to_add.id)
118 --- Anybody who can view resources should also see reservations
119 --- at the same level
122 FROM permission.perm_list
123 WHERE code = 'VIEW_BOOKING_RESOURCE'
128 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
130 'eg.grid.booking.pull_list', 'gui', 'object',
133 'Grid Config: Booking Pull List',
137 FROM config.workstation_setting_type
138 WHERE name = 'eg.grid.booking.pull_list'
143 INSERT INTO action_trigger.event_params (event_def, param, value)
144 SELECT id, 'check_sms_notify', 1
145 FROM action_trigger.event_definition
146 WHERE reactor = 'SendSMS'
147 AND validator IN ('HoldIsAvailable', 'HoldIsCancelled', 'HoldNotifyCheck')
149 SELECT * FROM action_trigger.event_params
150 WHERE param = 'check_sms_notify'
153 -- fill in the gaps, but only if the upgrade log indicates that
154 -- this database had been at version 3.6.0 at some point.
155 INSERT INTO config.upgrade_log (version, applied_to) SELECT '1236', :eg_version
156 WHERE NOT EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '1236')
157 AND EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '3.6.0');
158 INSERT INTO config.upgrade_log (version, applied_to) SELECT '1237', :eg_version
159 WHERE NOT EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '1237')
160 AND EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '3.6.0');
161 INSERT INTO config.upgrade_log (version, applied_to) SELECT '1238', :eg_version
162 WHERE NOT EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '1238')
163 AND EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '3.6.0');
164 INSERT INTO config.upgrade_log (version, applied_to) SELECT '1239', :eg_version
165 WHERE NOT EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '1239')
166 AND EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '3.6.0');
167 INSERT INTO config.upgrade_log (version, applied_to) SELECT '1240', :eg_version
168 WHERE NOT EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '1240')
169 AND EXISTS (SELECT 1 FROM config.upgrade_log WHERE version = '3.6.0');