1 --Upgrade Script for 2.11.3 to 2.12-beta
2 \set eg_version '''2.12-beta'''
5 SELECT evergreen.upgrade_deps_block_check('1006', :eg_version);
7 -- This function is used to help clean up facet labels. Due to quirks in
8 -- MARC parsing, some facet labels may be generated with periods or commas
9 -- at the end. This will strip a trailing commas off all the time, and
10 -- periods when they don't look like they are part of initials.
11 -- Smith, John => no change
12 -- Smith, John, => Smith, John
13 -- Smith, John. => Smith, John
14 -- Public, John Q. => no change
15 CREATE OR REPLACE FUNCTION metabib.trim_trailing_punctuation ( TEXT ) RETURNS TEXT AS $$
21 last_char = substring(result from '.$');
23 IF last_char = ',' THEN
24 result := substring(result from '^(.*),$');
26 ELSIF last_char = '.' THEN
27 IF substring(result from ' \w\.$') IS NULL THEN
28 result := substring(result from '^(.*)\.$');
35 $$ language 'plpgsql';
37 INSERT INTO config.index_normalizer (name, description, func, param_count) VALUES (
38 'Trim Trailing Punctuation',
39 'Eliminate extraneous trailing commas and periods in text',
40 'metabib.trim_trailing_punctuation',
44 INSERT INTO config.metabib_field_index_norm_map (field,norm,pos)
48 FROM config.metabib_field m,
49 config.index_normalizer i
50 WHERE i.func = 'metabib.trim_trailing_punctuation'
51 AND m.id IN (7,8,9,10);
53 SELECT evergreen.upgrade_deps_block_check('1007', :eg_version);
55 UPDATE config.record_attr_definition
56 SET description = oils_i18n_gettext('audience', 'Audience', 'crad', 'label')
57 WHERE description IS NULL
58 AND name = 'audience';
59 UPDATE config.record_attr_definition
60 SET description = oils_i18n_gettext('bib_level', 'Bib Level', 'crad', 'label')
61 WHERE description IS NULL
62 AND name = 'bib_level';
63 UPDATE config.record_attr_definition
64 SET description = oils_i18n_gettext('item_form', 'Item Form', 'crad', 'label')
65 WHERE description IS NULL
66 AND name = 'item_form';
67 UPDATE config.record_attr_definition
68 SET description = oils_i18n_gettext('item_lang', 'Language', 'crad', 'label')
69 WHERE description IS NULL
70 AND name = 'item_lang';
71 UPDATE config.record_attr_definition
72 SET description = oils_i18n_gettext('lit_form', 'Literary Form', 'crad', 'label')
73 WHERE description IS NULL
74 AND name = 'lit_form';
75 UPDATE config.record_attr_definition
76 SET description = oils_i18n_gettext('item_type', 'Item Type', 'crad', 'label')
77 WHERE description IS NULL
78 AND name = 'item_type';
79 UPDATE config.record_attr_definition
80 SET description = oils_i18n_gettext('vr_format', 'Video Format', 'crad', 'label')
81 WHERE description IS NULL
82 AND name = 'vr_format';
84 SELECT evergreen.upgrade_deps_block_check('1008', :eg_version);
86 CREATE OR REPLACE FUNCTION evergreen.unaccent_and_squash ( IN arg text) RETURNS text
87 IMMUTABLE STRICT AS $$
89 RETURN evergreen.lowercase(unaccent(regexp_replace(arg, '[\s[:punct:]]','','g')));
93 SELECT evergreen.upgrade_deps_block_check('1009', :eg_version);
95 INSERT into config.org_unit_setting_type
96 ( name, grp, label, description, datatype, fm_class ) VALUES
97 ( 'acq.copy_status_on_receiving', 'acq',
98 oils_i18n_gettext('acq.copy_status_on_receiving',
99 'Initial status for received items',
101 oils_i18n_gettext('acq.copy_status_on_receiving',
102 'Allows staff to designate a custom copy status on received lineitems. Default status is "In Process".',
103 'coust', 'description'),
106 -- remove unused org unit setting for self checkout interface
107 SELECT evergreen.upgrade_deps_block_check('1010', :eg_version);
109 DELETE FROM actor.org_unit_setting WHERE name = 'circ.selfcheck.require_patron_password';
111 DELETE FROM config.org_unit_setting_type WHERE name = 'circ.selfcheck.require_patron_password';
113 DELETE FROM config.org_unit_setting_type_log WHERE field_name = 'circ.selfcheck.require_patron_password';
115 DELETE FROM permission.usr_perm_map WHERE perm IN (SELECT id FROM permission.perm_list WHERE code = 'UPDATE_ORG_UNIT_SETTING.circ.selfcheck.require_patron_password');
117 DELETE FROM permission.grp_perm_map WHERE perm IN (SELECT id FROM permission.perm_list WHERE code = 'UPDATE_ORG_UNIT_SETTING.circ.selfcheck.require_patron_password');
119 DELETE FROM permission.perm_list WHERE code = 'UPDATE_ORG_UNIT_SETTING.circ.selfcheck.require_patron_password';
121 SELECT evergreen.upgrade_deps_block_check('1011', :eg_version);
123 INSERT INTO config.org_unit_setting_type
124 (name, grp, label, description, datatype)
126 ('circ.in_house_use.copy_alert',
128 oils_i18n_gettext('circ.in_house_use.copy_alert',
129 'Display copy alert for in-house-use',
131 oils_i18n_gettext('circ.in_house_use.copy_alert',
132 'Display copy alert for in-house-use',
133 'coust', 'description'),
135 ('circ.in_house_use.checkin_alert',
137 oils_i18n_gettext('circ.in_house_use.checkin_alert',
138 'Display copy location checkin alert for in-house-use',
140 oils_i18n_gettext('circ.in_house_use.checkin_alert',
141 'Display copy location checkin alert for in-house-use',
142 'coust', 'description'),
145 SELECT evergreen.upgrade_deps_block_check('1014', :eg_version);
146 -- this update of unapi.mmr_mra() removed since 1015 has a newer version
148 SELECT evergreen.upgrade_deps_block_check('1015', :eg_version);
150 CREATE OR REPLACE FUNCTION unapi.mmr_mra (
156 depth INT DEFAULT NULL,
157 slimit HSTORE DEFAULT NULL,
158 soffset HSTORE DEFAULT NULL,
159 include_xmlns BOOL DEFAULT TRUE,
160 pref_lib INT DEFAULT NULL
165 CASE WHEN $9 THEN 'http://open-ils.org/spec/indexing/v1' ELSE NULL END AS xmlns,
166 'tag:open-ils.org:U2@mmr/' || $1 AS metarecord
168 (SELECT XMLAGG(foo.y)
171 WITH aou AS (SELECT COALESCE(id, (evergreen.org_top()).id) AS id
172 FROM actor.org_unit WHERE shortname = $5 LIMIT 1)
174 FROM metabib.metarecord_source_map mmsm, aou
175 WHERE metarecord = $1 AND (
177 SELECT 1 FROM asset.opac_visible_copies
178 WHERE record = source AND circ_lib IN (
179 SELECT id FROM actor.org_unit_descendants(aou.id, $6))
182 OR EXISTS (SELECT 1 FROM located_uris(source, aou.id, $10) LIMIT 1)
183 OR EXISTS (SELECT 1 FROM biblio.record_entry b JOIN config.bib_source src ON (b.source = src.id) WHERE src.transcendant AND b.id = mmsm.source LIMIT 1)
191 cmra.value AS "coded-value",
202 SELECT DISTINCT aid, attr, value, STRING_AGG(x.id::TEXT, ',') AS source_list
204 SELECT v.source AS id,
208 FROM metabib.record_attr_vector_list v
209 JOIN config.coded_value_map c ON ( c.id = ANY( v.vlist ) )
211 JOIN sourcelist ON (x.id = sourcelist.source)
214 JOIN config.record_attr_definition rad ON (cmra.attr = rad.name)
229 SELECT DISTINCT aid, attr, value
231 SELECT v.source AS id,
235 FROM metabib.record_attr_vector_list v
236 JOIN metabib.uncontrolled_record_attr_value m ON ( m.id = ANY( v.vlist ) )
238 JOIN sourcelist ON (x.id = sourcelist.source)
240 JOIN config.record_attr_definition rad ON (umra.attr = rad.name)
246 $F$ LANGUAGE SQL STABLE;
248 SELECT evergreen.upgrade_deps_block_check('1016', :eg_version);
250 INSERT INTO config.biblio_fingerprint (name, xpath, format)
253 '//mods32:mods/mods32:titleInfo/mods32:partName',
257 INSERT INTO config.biblio_fingerprint (name, xpath, format)
260 '//mods32:mods/mods32:titleInfo/mods32:partNumber',
264 SELECT evergreen.upgrade_deps_block_check('1017', :eg_version);
266 CREATE OR REPLACE FUNCTION biblio.extract_fingerprint ( marc text ) RETURNS TEXT AS $func$
268 idx config.biblio_fingerprint%ROWTYPE;
269 xfrm config.xml_transform%ROWTYPE;
271 transformed_xml TEXT;
273 xml_node_list TEXT[];
275 output_text TEXT := '';
278 IF marc IS NULL OR marc = '' THEN
282 -- Loop over the indexing entries
283 FOR idx IN SELECT * FROM config.biblio_fingerprint ORDER BY format, id LOOP
285 SELECT INTO xfrm * from config.xml_transform WHERE name = idx.format;
287 -- See if we can skip the XSLT ... it's expensive
288 IF prev_xfrm IS NULL OR prev_xfrm <> xfrm.name THEN
289 -- Can't skip the transform
290 IF xfrm.xslt <> '---' THEN
291 transformed_xml := oils_xslt_process(marc,xfrm.xslt);
293 transformed_xml := marc;
296 prev_xfrm := xfrm.name;
299 raw_text := COALESCE(
307 ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]]
316 raw_text := REGEXP_REPLACE(raw_text, E'\\[.+?\\]', E'');
317 raw_text := REGEXP_REPLACE(raw_text, E'\\mthe\\M|\\man?d?d\\M', E'', 'g'); -- arg! the pain!
319 IF idx.first_word IS TRUE THEN
320 raw_text := REGEXP_REPLACE(raw_text, E'^(\\w+).*?$', E'\\1');
323 output_text := output_text || idx.name || ':' ||
324 REGEXP_REPLACE(raw_text, E'\\s+', '', 'g') || ' ';
328 RETURN BTRIM(output_text);
331 $func$ LANGUAGE PLPGSQL;
333 SELECT evergreen.upgrade_deps_block_check('1019', :eg_version);
335 CREATE OR REPLACE FUNCTION
336 action.hold_request_regen_copy_maps(
337 hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$
338 DELETE FROM action.hold_copy_map WHERE hold = $1;
339 INSERT INTO action.hold_copy_map (hold, target_copy) SELECT $1, UNNEST($2);
344 INSERT INTO config.global_flag (name, label, value, enabled) VALUES (
345 'circ.holds.retarget_interval',
347 'circ.holds.retarget_interval',
348 'Holds Retarget Interval',
356 SELECT evergreen.upgrade_deps_block_check('1020', :eg_version);
358 CREATE OR REPLACE FUNCTION actor.org_unit_ancestor_setting_batch_by_org(
359 setting_name TEXT, org_ids INTEGER[])
360 RETURNS SETOF actor.org_unit_setting AS
366 /* Returns one actor.org_unit_setting row per org unit ID provided.
367 When no setting exists for a given org unit, the setting row
368 will contain all empty values. */
369 FOREACH org_id IN ARRAY org_ids LOOP
370 SELECT INTO setting * FROM
371 actor.org_unit_ancestor_setting(setting_name, org_id);
376 $FUNK$ LANGUAGE plpgsql STABLE;
378 SELECT evergreen.upgrade_deps_block_check('1021', :eg_version);
380 -- Add missing permissions noted in LP 1517137 adjusting those added manually and ignoring those already in place.
383 DECLARE fixperm TEXT[3];
384 DECLARE modify BOOLEAN;
385 DECLARE permid BIGINT;
386 DECLARE oldid BIGINT;
389 FOREACH fixperm SLICE 1 IN ARRAY ARRAY[
390 ['564', 'MARK_ITEM_CATALOGING', 'Allow a user to mark an item status as ''cataloging'''],
391 ['565', 'MARK_ITEM_DAMAGED', 'Allow a user to mark an item status as ''damaged'''],
392 ['566', 'MARK_ITEM_DISCARD', 'Allow a user to mark an item status as ''discard'''],
393 ['567', 'MARK_ITEM_RESERVES', 'Allow a user to mark an item status as ''reserves'''],
394 ['568', 'ADMIN_ORG_UNIT_SETTING_TYPE_LOG', 'Allow a user to modify the org unit settings log'],
395 ['570', 'CREATE_POP_BADGE', 'Allow a user to create a new popularity badge'],
396 ['571', 'DELETE_POP_BADGE', 'Allow a user to delete a popularity badge'],
397 ['572', 'UPDATE_POP_BADGE', 'Allow a user to modify a popularity badge'],
398 ['573', 'CREATE_POP_PARAMETER', 'Allow a user to create a popularity badge parameter'],
399 ['574', 'DELETE_POP_PARAMETER', 'Allow a user to delete a popularity badge parameter'],
400 ['575', 'UPDATE_POP_PARAMETER', 'Allow a user to modify a popularity badge parameter'],
401 ['576', 'CREATE_AUTHORITY_RECORD', 'Allow a user to create an authority record'],
402 ['577', 'DELETE_AUTHORITY_RECORD', 'Allow a user to delete an authority record'],
403 ['578', 'UPDATE_AUTHORITY_RECORD', 'Allow a user to modify an authority record'],
404 ['579', 'CREATE_AUTHORITY_CONTROL_SET', 'Allow a user to create an authority control set'],
405 ['580', 'DELETE_AUTHORITY_CONTROL_SET', 'Allow a user to delete an authority control set'],
406 ['581', 'UPDATE_AUTHORITY_CONTROL_SET', 'Allow a user to modify an authority control set'],
407 ['582', 'ACTOR_USER_DELETE_OPEN_XACTS.override', 'Override the ACTOR_USER_DELETE_OPEN_XACTS event'],
408 ['583', 'PATRON_EXCEEDS_LOST_COUNT.override', 'Override the PATRON_EXCEEDS_LOST_COUNT event'],
409 ['584', 'MAX_HOLDS.override', 'Override the MAX_HOLDS event'],
410 ['585', 'ITEM_DEPOSIT_REQUIRED.override', 'Override the ITEM_DEPOSIT_REQUIRED event'],
411 ['586', 'ITEM_DEPOSIT_PAID.override', 'Override the ITEM_DEPOSIT_PAID event'],
412 ['587', 'COPY_STATUS_LOST_AND_PAID.override', 'Override the COPY_STATUS_LOST_AND_PAID event'],
413 ['588', 'ITEM_NOT_HOLDABLE.override', 'Override the ITEM_NOT_HOLDABLE event'],
414 ['589', 'ITEM_RENTAL_FEE_REQUIRED.override', 'Override the ITEM_RENTAL_FEE_REQUIRED event']
417 permid := CAST (fixperm[1] AS BIGINT);
418 -- Has this permission already been manually applied at the expected id?
419 PERFORM * FROM permission.perm_list WHERE id = permid;
421 UPDATE permission.perm_list SET code = code || '_local' WHERE code = fixperm[2] AND id > 1000 RETURNING id INTO oldid;
424 INSERT INTO permission.perm_list (id, code, description) VALUES (permid, fixperm[2], fixperm[3]);
426 -- Several of these are rather unlikely for these particular permissions but safer > sorry.
428 UPDATE permission.grp_perm_map SET perm = permid WHERE perm = oldid;
429 UPDATE config.org_unit_setting_type SET update_perm = permid WHERE update_perm = oldid;
430 UPDATE permission.usr_object_perm_map SET perm = permid WHERE perm = oldid;
431 UPDATE permission.usr_perm_map SET perm = permid WHERE perm = oldid;
432 UPDATE config.org_unit_setting_type SET view_perm = permid WHERE view_perm = oldid;
433 UPDATE config.z3950_source SET use_perm = permid WHERE use_perm = oldid;
434 DELETE FROM permission.perm_list WHERE id = oldid;
441 SELECT evergreen.upgrade_deps_block_check('1022', :eg_version);
443 CREATE OR REPLACE FUNCTION vandelay.merge_record_xml_using_profile ( incoming_marc TEXT, existing_marc TEXT, merge_profile_id BIGINT ) RETURNS TEXT AS $$
445 merge_profile vandelay.merge_profile%ROWTYPE;
446 dyn_profile vandelay.compile_profile%ROWTYPE;
453 IF existing_marc IS NULL OR incoming_marc IS NULL THEN
454 -- RAISE NOTICE 'no marc for source or target records';
458 IF merge_profile_id IS NOT NULL THEN
459 SELECT * INTO merge_profile FROM vandelay.merge_profile WHERE id = merge_profile_id;
461 dyn_profile.add_rule := COALESCE(merge_profile.add_spec,'');
462 dyn_profile.strip_rule := COALESCE(merge_profile.strip_spec,'');
463 dyn_profile.replace_rule := COALESCE(merge_profile.replace_spec,'');
464 dyn_profile.preserve_rule := COALESCE(merge_profile.preserve_spec,'');
466 -- RAISE NOTICE 'merge profile not found';
470 -- RAISE NOTICE 'no merge profile specified';
474 IF dyn_profile.replace_rule <> '' AND dyn_profile.preserve_rule <> '' THEN
475 -- RAISE NOTICE 'both replace [%] and preserve [%] specified', dyn_profile.replace_rule, dyn_profile.preserve_rule;
479 IF dyn_profile.replace_rule = '' AND dyn_profile.preserve_rule = '' AND dyn_profile.add_rule = '' AND dyn_profile.strip_rule = '' THEN
480 -- Since we have nothing to do, just return a target record as is
481 RETURN existing_marc;
482 ELSIF dyn_profile.preserve_rule <> '' THEN
483 source_marc = existing_marc;
484 target_marc = incoming_marc;
485 replace_rule = dyn_profile.preserve_rule;
487 source_marc = incoming_marc;
488 target_marc = existing_marc;
489 replace_rule = dyn_profile.replace_rule;
492 RETURN vandelay.merge_record_xml( target_marc, source_marc, dyn_profile.add_rule, replace_rule, dyn_profile.strip_rule );
497 SELECT evergreen.upgrade_deps_block_check('1023', :eg_version);
499 INSERT into config.org_unit_setting_type
500 ( name, grp, label, description, datatype, fm_class ) VALUES
502 'cat.default_merge_profile', 'cat',
504 'cat.default_merge_profile',
505 'Default Merge Profile (Z39.50 and Record Buckets)',
510 'cat.default_merge_profile',
511 'Default merge profile to use during Z39.50 imports and record bucket merges',
519 SELECT evergreen.upgrade_deps_block_check('1024', :eg_version);
521 -- Add new column "rtl" with default of false
522 ALTER TABLE config.i18n_locale ADD COLUMN rtl BOOL NOT NULL DEFAULT FALSE;
524 SELECT evergreen.upgrade_deps_block_check('1025', :eg_version);
526 -- Add Arabic (Jordan) to i18n_locale table as a stock language option
527 INSERT INTO config.i18n_locale (code,marc_code,name,description,rtl)
528 VALUES ('ar-JO', 'ara', oils_i18n_gettext('ar-JO', 'Arabic (Jordan)', 'i18n_l', 'name'),
529 oils_i18n_gettext('ar-JO', 'Arabic (Jordan)', 'i18n_l', 'description'), 'true');
531 SELECT evergreen.upgrade_deps_block_check('1026', :eg_version);
533 INSERT INTO config.metabib_field ( id, field_class, name, label,
534 format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
535 (34, 'subject', 'topic_browse', oils_i18n_gettext(34, 'Topic Browse', 'cmf', 'label'),
536 'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "topic"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
538 INSERT INTO config.metabib_field ( id, field_class, name, label,
539 format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
540 (35, 'subject', 'geographic_browse', oils_i18n_gettext(35, 'Geographic Name Browse', 'cmf', 'label'),
541 'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "geographic"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
543 INSERT INTO config.metabib_field ( id, field_class, name, label,
544 format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
545 (36, 'subject', 'temporal_browse', oils_i18n_gettext(36, 'Temporal Term Browse', 'cmf', 'label'),
546 'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "temporal"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
548 INSERT INTO config.metabib_field_index_norm_map (field,norm)
551 FROM config.metabib_field m,
552 config.index_normalizer i
553 WHERE i.func IN ('naco_normalize')
554 AND m.id IN (34, 35, 36);
556 UPDATE config.metabib_field
557 SET browse_field = FALSE
558 WHERE field_class = 'subject' AND name = 'topic'
560 UPDATE config.metabib_field
561 SET browse_field = FALSE
562 WHERE field_class = 'subject' AND name = 'geographic'
564 UPDATE config.metabib_field
565 SET browse_field = FALSE
566 WHERE field_class = 'subject' AND name = 'temporal'
569 UPDATE authority.control_set_bib_field_metabib_field_map
570 SET metabib_field = 34
571 WHERE metabib_field = 14;
572 UPDATE authority.control_set_bib_field_metabib_field_map
573 SET metabib_field = 35
574 WHERE metabib_field = 13;
575 UPDATE authority.control_set_bib_field_metabib_field_map
576 SET metabib_field = 36
577 WHERE metabib_field = 11;
579 SELECT evergreen.upgrade_deps_block_check('1027', :eg_version);
581 INSERT INTO config.settings_group (name, label)
582 VALUES ('ebook_api', 'Ebook API Integration');
584 INSERT INTO config.org_unit_setting_type
585 (name, label, description, grp, datatype)
587 'ebook_api.oneclickdigital.library_id',
589 'ebook_api.oneclickdigital.library_id',
590 'OneClickdigital Library ID',
595 'ebook_api.oneclickdigital.library_id',
596 'Identifier assigned to this library by OneClickdigital',
603 'ebook_api.oneclickdigital.basic_token',
605 'ebook_api.oneclickdigital.basic_token',
606 'OneClickdigital Basic Token',
611 'ebook_api.oneclickdigital.basic_token',
612 'Basic token for client authentication with OneClickdigital API (supplied by OneClickdigital)',
620 INSERT INTO config.org_unit_setting_type
621 (name, label, description, grp, datatype)
623 'ebook_api.overdrive.discovery_base_uri',
625 'ebook_api.overdrive.discovery_base_uri',
626 'OverDrive Discovery API Base URI',
631 'ebook_api.overdrive.discovery_base_uri',
632 'Base URI for OverDrive Discovery API (defaults to https://api.overdrive.com/v1). Using HTTPS here is strongly encouraged.',
639 'ebook_api.overdrive.circulation_base_uri',
641 'ebook_api.overdrive.circulation_base_uri',
642 'OverDrive Circulation API Base URI',
647 'ebook_api.overdrive.circulation_base_uri',
648 'Base URI for OverDrive Circulation API (defaults to https://patron.api.overdrive.com/v1). Using HTTPS here is strongly encouraged.',
655 'ebook_api.overdrive.account_id',
657 'ebook_api.overdrive.account_id',
658 'OverDrive Account ID',
663 'ebook_api.overdrive.account_id',
664 'Account ID (a.k.a. Library ID) for this library, as assigned by OverDrive',
671 'ebook_api.overdrive.websiteid',
673 'ebook_api.overdrive.websiteid',
674 'OverDrive Website ID',
679 'ebook_api.overdrive.websiteid',
680 'Website ID for this library, as assigned by OverDrive',
687 'ebook_api.overdrive.authorizationname',
689 'ebook_api.overdrive.authorizationname',
690 'OverDrive Authorization Name',
695 'ebook_api.overdrive.authorizationname',
696 'Authorization name for this library, as assigned by OverDrive',
703 'ebook_api.overdrive.basic_token',
705 'ebook_api.overdrive.basic_token',
706 'OverDrive Basic Token',
711 'ebook_api.overdrive.basic_token',
712 'Basic token for client authentication with OverDrive API (supplied by OverDrive)',
719 'ebook_api.overdrive.granted_auth_redirect_uri',
721 'ebook_api.overdrive.granted_auth_redirect_uri',
722 'OverDrive Granted Authorization Redirect URI',
727 'ebook_api.overdrive.granted_auth_redirect_uri',
728 'URI provided to OverDrive for use with granted authorization',
735 'ebook_api.overdrive.password_required',
737 'ebook_api.overdrive.password_required',
738 'OverDrive Password Required',
743 'ebook_api.overdrive.password_required',
744 'Does this library require a password when authenticating patrons with the OverDrive API?',
754 \qecho Running some data updates outside of the main transaction
755 \qecho =========================================================
756 \qecho Update some indexes on actor.usr
757 REINDEX INDEX actor.actor_usr_first_given_name_unaccent_idx;
758 REINDEX INDEX actor.actor_usr_second_given_name_unaccent_idx;
759 REINDEX INDEX actor.actor_usr_family_name_unaccent_idx;
761 \qecho Recalculating bib fingerprints; this may take a while
762 ALTER TABLE biblio.record_entry DISABLE TRIGGER USER;
763 UPDATE biblio.record_entry SET fingerprint = biblio.extract_fingerprint(marc) WHERE NOT deleted;
764 ALTER TABLE biblio.record_entry ENABLE TRIGGER USER;
766 \qecho Remapping metarecords
767 SELECT metabib.remap_metarecord_for_bib(id, fingerprint)
768 FROM biblio.record_entry
771 \qecho Running a browse-only reingest of your bib records. It may take a while.
772 \qecho You may cancel now without losing the effect of the rest of the
773 \qecho upgrade script, and arrange the reingest later.
775 SELECT metabib.reingest_metabib_field_entries(id, TRUE, FALSE, TRUE)
776 FROM biblio.record_entry;