1 --Upgrade Script for 3.2.5 to 3.3.0
2 \set eg_version '''3.3.0'''
4 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('3.3.0', :eg_version);
6 SELECT evergreen.upgrade_deps_block_check('1135', :eg_version);
8 CREATE OR REPLACE FUNCTION biblio.indexing_ingest_or_delete () RETURNS TRIGGER AS $func$
13 IF NEW.deleted THEN -- If this bib is deleted
15 PERFORM * FROM config.internal_flag WHERE
16 name = 'ingest.metarecord_mapping.preserve_on_delete' AND enabled;
18 tmp_bool := FOUND; -- Just in case this is changed by some other statement
20 PERFORM metabib.remap_metarecord_for_bib( NEW.id, NEW.fingerprint, TRUE, tmp_bool );
23 -- One needs to keep these around to support searches
24 -- with the #deleted modifier, so one should turn on the named
25 -- internal flag for that functionality.
26 DELETE FROM metabib.record_attr_vector_list WHERE source = NEW.id;
29 DELETE FROM authority.bib_linking WHERE bib = NEW.id; -- Avoid updating fields in bibs that are no longer visible
30 DELETE FROM biblio.peer_bib_copy_map WHERE peer_record = NEW.id; -- Separate any multi-homed items
31 DELETE FROM metabib.browse_entry_def_map WHERE source = NEW.id; -- Don't auto-suggest deleted bibs
32 RETURN NEW; -- and we're done
35 IF TG_OP = 'UPDATE' AND OLD.deleted IS FALSE THEN -- re-ingest?
36 PERFORM * FROM config.internal_flag WHERE name = 'ingest.reingest.force_on_same_marc' AND enabled;
38 IF NOT FOUND AND OLD.marc = NEW.marc THEN -- don't do anything if the MARC didn't change
43 -- Record authority linking
44 PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_authority_linking' AND enabled;
46 PERFORM biblio.map_authority_linking( NEW.id, NEW.marc );
49 -- Flatten and insert the mfr data
50 PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_metabib_full_rec' AND enabled;
52 PERFORM metabib.reingest_metabib_full_rec(NEW.id);
54 -- Now we pull out attribute data, which is dependent on the mfr for all but XPath-based fields
55 PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_metabib_rec_descriptor' AND enabled;
57 PERFORM metabib.reingest_record_attributes(NEW.id, NULL, NEW.marc, TG_OP = 'INSERT' OR OLD.deleted);
61 -- Gather and insert the field entry data
62 PERFORM metabib.reingest_metabib_field_entries(NEW.id);
65 PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_located_uri' AND enabled;
66 IF NOT FOUND THEN PERFORM biblio.extract_located_uris( NEW.id, NEW.marc, NEW.editor ); END IF;
68 -- (re)map metarecord-bib linking
69 IF TG_OP = 'INSERT' THEN -- if not deleted and performing an insert, check for the flag
70 PERFORM * FROM config.internal_flag WHERE name = 'ingest.metarecord_mapping.skip_on_insert' AND enabled;
72 PERFORM metabib.remap_metarecord_for_bib( NEW.id, NEW.fingerprint );
74 ELSE -- we're doing an update, and we're not deleted, remap
75 PERFORM * FROM config.internal_flag WHERE name = 'ingest.metarecord_mapping.skip_on_update' AND enabled;
77 PERFORM metabib.remap_metarecord_for_bib( NEW.id, NEW.fingerprint );
83 $func$ LANGUAGE PLPGSQL;
88 SELECT evergreen.upgrade_deps_block_check('1139', :eg_version);
90 ALTER TABLE actor.usr ADD COLUMN guardian TEXT;
92 CREATE INDEX actor_usr_guardian_idx
93 ON actor.usr (evergreen.lowercase(guardian));
94 CREATE INDEX actor_usr_guardian_unaccent_idx
95 ON actor.usr (evergreen.unaccent_and_squash(guardian));
97 -- Modify auditor tables accordingly.
98 SELECT auditor.update_auditors();
100 -- clear the guardian field on delete
101 CREATE OR REPLACE FUNCTION actor.usr_delete(
106 old_profile actor.usr.profile%type;
107 old_home_ou actor.usr.home_ou%type;
108 new_profile actor.usr.profile%type;
109 new_home_ou actor.usr.home_ou%type;
111 new_dob actor.usr.dob%type;
114 id || '-PURGED-' || now(),
128 -- Quit if no such user
130 IF old_profile IS NULL THEN
134 perform actor.usr_purge_data( src_usr, dest_usr );
136 -- Find the root grp_tree and the root org_unit. This would be simpler if we
137 -- could assume that there is only one root. Theoretically, someday, maybe,
138 -- there could be multiple roots, so we take extra trouble to get the right ones.
145 permission.grp_ancestors( old_profile )
154 actor.org_unit_ancestors( old_home_ou )
158 -- Truncate date of birth
160 IF new_dob IS NOT NULL THEN
161 new_dob := date_trunc( 'year', new_dob );
168 profile = new_profile,
171 passwd = random()::text,
176 FROM config.identification_type
181 net_access_level = DEFAULT,
184 first_given_name = new_name,
186 family_name = new_name,
191 evening_phone = NULL,
193 mailing_address = NULL,
194 billing_address = NULL,
195 home_ou = new_home_ou,
198 master_account = DEFAULT,
199 super_user = DEFAULT,
204 claims_returned_count = DEFAULT,
205 credit_forward_balance = DEFAULT,
206 last_xact_id = DEFAULT,
207 alert_message = NULL,
215 INSERT into config.org_unit_setting_type (name, label, description, datatype)
217 'ui.patron.edit.au.guardian.show',
219 'ui.patron.edit.au.guardian.show',
220 'GUI: Show guardian field on patron registration',
224 'ui.patron.edit.au.guardian.show',
225 'The guardian field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.',
226 'coust', 'description'
230 'ui.patron.edit.au.guardian.suggest',
232 'ui.patron.edit.au.guardian.suggest',
233 'GUI: Suggest guardian field on patron registration',
237 'ui.patron.edit.au.guardian.suggest',
238 'The guardian field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
239 'coust', 'description'),
242 'ui.patron.edit.guardian_required_for_juv',
244 'ui.patron.edit.guardian_required_for_juv',
245 'GUI: Juvenile account requires parent/guardian',
249 'ui.patron.edit.guardian_required_for_juv',
250 'Require a value for the parent/guardian field in the patron editor for patrons marked as juvenile',
251 'coust', 'description'),
258 SELECT evergreen.upgrade_deps_block_check('1140', :eg_version);
260 DROP FUNCTION IF EXISTS evergreen.org_top();
262 CREATE OR REPLACE FUNCTION evergreen.org_top()
263 RETURNS actor.org_unit AS $$
264 SELECT * FROM actor.org_unit WHERE parent_ou IS NULL LIMIT 1;
265 $$ LANGUAGE SQL STABLE;
268 SELECT evergreen.upgrade_deps_block_check('1143', :eg_version);
270 INSERT into config.workstation_setting_type (name, grp, datatype, label)
272 'eg.grid.admin.booking.resource', 'gui', 'object',
274 'eg.grid.admin.booking.resource',
275 'Grid Config: admin.booking.resource',
279 'eg.grid.admin.booking.resource_attr', 'gui', 'object',
281 'eg.grid.admin.booking.resource_attr',
282 'Grid Config: admin.booking.resource_attr',
286 'eg.grid.admin.booking.resource_attr_map', 'gui', 'object',
288 'eg.grid.admin.booking.resource_attr_map',
289 'Grid Config: admin.booking.resource_attr_map',
293 'eg.grid.admin.booking.resource_attr_value', 'gui', 'object',
295 'eg.grid.admin.booking.resource_attr_value',
296 'Grid Config: admin.booking.resource_attr_value',
300 'eg.grid.admin.booking.resource_type', 'gui', 'object',
302 'eg.grid.admin.booking.resource_type',
303 'Grid Config: admin.booking.resource_type',
309 INSERT INTO config.upgrade_log (version) VALUES ('1144');
311 CREATE TABLE actor.usr_privacy_waiver (
312 id BIGSERIAL PRIMARY KEY,
313 usr BIGINT NOT NULL REFERENCES actor.usr(id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
315 place_holds BOOL DEFAULT FALSE,
316 pickup_holds BOOL DEFAULT FALSE,
317 view_history BOOL DEFAULT FALSE,
318 checkout_items BOOL DEFAULT FALSE
320 CREATE INDEX actor_usr_privacy_waiver_usr_idx ON actor.usr_privacy_waiver (usr);
324 INSERT INTO config.upgrade_log (version) VALUES ('1145');
326 CREATE OR REPLACE FUNCTION actor.usr_purge_data(
328 specified_dest_usr IN INTEGER
332 renamable_row RECORD;
336 IF specified_dest_usr IS NULL THEN
337 dest_usr := 1; -- Admin user on stock installs
339 dest_usr := specified_dest_usr;
343 UPDATE acq.fund_allocation SET allocator = dest_usr WHERE allocator = src_usr;
344 UPDATE acq.lineitem SET creator = dest_usr WHERE creator = src_usr;
345 UPDATE acq.lineitem SET editor = dest_usr WHERE editor = src_usr;
346 UPDATE acq.lineitem SET selector = dest_usr WHERE selector = src_usr;
347 UPDATE acq.lineitem_note SET creator = dest_usr WHERE creator = src_usr;
348 UPDATE acq.lineitem_note SET editor = dest_usr WHERE editor = src_usr;
349 UPDATE acq.invoice SET closed_by = dest_usr WHERE closed_by = src_usr;
350 DELETE FROM acq.lineitem_usr_attr_definition WHERE usr = src_usr;
352 -- Update with a rename to avoid collisions
356 WHERE owner = src_usr
358 suffix := ' (' || src_usr || ')';
362 SET owner = dest_usr, name = name || suffix
363 WHERE id = renamable_row.id;
364 EXCEPTION WHEN unique_violation THEN
365 suffix := suffix || ' ';
372 UPDATE acq.picklist SET creator = dest_usr WHERE creator = src_usr;
373 UPDATE acq.picklist SET editor = dest_usr WHERE editor = src_usr;
374 UPDATE acq.po_note SET creator = dest_usr WHERE creator = src_usr;
375 UPDATE acq.po_note SET editor = dest_usr WHERE editor = src_usr;
376 UPDATE acq.purchase_order SET owner = dest_usr WHERE owner = src_usr;
377 UPDATE acq.purchase_order SET creator = dest_usr WHERE creator = src_usr;
378 UPDATE acq.purchase_order SET editor = dest_usr WHERE editor = src_usr;
379 UPDATE acq.claim_event SET creator = dest_usr WHERE creator = src_usr;
382 DELETE FROM action.circulation WHERE usr = src_usr;
383 UPDATE action.circulation SET circ_staff = dest_usr WHERE circ_staff = src_usr;
384 UPDATE action.circulation SET checkin_staff = dest_usr WHERE checkin_staff = src_usr;
385 UPDATE action.hold_notification SET notify_staff = dest_usr WHERE notify_staff = src_usr;
386 UPDATE action.hold_request SET fulfillment_staff = dest_usr WHERE fulfillment_staff = src_usr;
387 UPDATE action.hold_request SET requestor = dest_usr WHERE requestor = src_usr;
388 DELETE FROM action.hold_request WHERE usr = src_usr;
389 UPDATE action.in_house_use SET staff = dest_usr WHERE staff = src_usr;
390 UPDATE action.non_cat_in_house_use SET staff = dest_usr WHERE staff = src_usr;
391 DELETE FROM action.non_cataloged_circulation WHERE patron = src_usr;
392 UPDATE action.non_cataloged_circulation SET staff = dest_usr WHERE staff = src_usr;
393 DELETE FROM action.survey_response WHERE usr = src_usr;
394 UPDATE action.fieldset SET owner = dest_usr WHERE owner = src_usr;
395 DELETE FROM action.usr_circ_history WHERE usr = src_usr;
398 DELETE FROM actor.card WHERE usr = src_usr;
399 DELETE FROM actor.stat_cat_entry_usr_map WHERE target_usr = src_usr;
400 DELETE FROM actor.usr_privacy_waiver WHERE usr = src_usr;
402 -- The following update is intended to avoid transient violations of a foreign
403 -- key constraint, whereby actor.usr_address references itself. It may not be
404 -- necessary, but it does no harm.
405 UPDATE actor.usr_address SET replaces = NULL
406 WHERE usr = src_usr AND replaces IS NOT NULL;
407 DELETE FROM actor.usr_address WHERE usr = src_usr;
408 DELETE FROM actor.usr_note WHERE usr = src_usr;
409 UPDATE actor.usr_note SET creator = dest_usr WHERE creator = src_usr;
410 DELETE FROM actor.usr_org_unit_opt_in WHERE usr = src_usr;
411 UPDATE actor.usr_org_unit_opt_in SET staff = dest_usr WHERE staff = src_usr;
412 DELETE FROM actor.usr_setting WHERE usr = src_usr;
413 DELETE FROM actor.usr_standing_penalty WHERE usr = src_usr;
414 UPDATE actor.usr_standing_penalty SET staff = dest_usr WHERE staff = src_usr;
417 UPDATE asset.call_number SET creator = dest_usr WHERE creator = src_usr;
418 UPDATE asset.call_number SET editor = dest_usr WHERE editor = src_usr;
419 UPDATE asset.call_number_note SET creator = dest_usr WHERE creator = src_usr;
420 UPDATE asset.copy SET creator = dest_usr WHERE creator = src_usr;
421 UPDATE asset.copy SET editor = dest_usr WHERE editor = src_usr;
422 UPDATE asset.copy_note SET creator = dest_usr WHERE creator = src_usr;
425 DELETE FROM auditor.actor_usr_address_history WHERE id = src_usr;
426 DELETE FROM auditor.actor_usr_history WHERE id = src_usr;
427 UPDATE auditor.asset_call_number_history SET creator = dest_usr WHERE creator = src_usr;
428 UPDATE auditor.asset_call_number_history SET editor = dest_usr WHERE editor = src_usr;
429 UPDATE auditor.asset_copy_history SET creator = dest_usr WHERE creator = src_usr;
430 UPDATE auditor.asset_copy_history SET editor = dest_usr WHERE editor = src_usr;
431 UPDATE auditor.biblio_record_entry_history SET creator = dest_usr WHERE creator = src_usr;
432 UPDATE auditor.biblio_record_entry_history SET editor = dest_usr WHERE editor = src_usr;
435 UPDATE biblio.record_entry SET creator = dest_usr WHERE creator = src_usr;
436 UPDATE biblio.record_entry SET editor = dest_usr WHERE editor = src_usr;
437 UPDATE biblio.record_note SET creator = dest_usr WHERE creator = src_usr;
438 UPDATE biblio.record_note SET editor = dest_usr WHERE editor = src_usr;
441 -- Update buckets with a rename to avoid collisions
444 FROM container.biblio_record_entry_bucket
445 WHERE owner = src_usr
447 suffix := ' (' || src_usr || ')';
450 UPDATE container.biblio_record_entry_bucket
451 SET owner = dest_usr, name = name || suffix
452 WHERE id = renamable_row.id;
453 EXCEPTION WHEN unique_violation THEN
454 suffix := suffix || ' ';
463 FROM container.call_number_bucket
464 WHERE owner = src_usr
466 suffix := ' (' || src_usr || ')';
469 UPDATE container.call_number_bucket
470 SET owner = dest_usr, name = name || suffix
471 WHERE id = renamable_row.id;
472 EXCEPTION WHEN unique_violation THEN
473 suffix := suffix || ' ';
482 FROM container.copy_bucket
483 WHERE owner = src_usr
485 suffix := ' (' || src_usr || ')';
488 UPDATE container.copy_bucket
489 SET owner = dest_usr, name = name || suffix
490 WHERE id = renamable_row.id;
491 EXCEPTION WHEN unique_violation THEN
492 suffix := suffix || ' ';
501 FROM container.user_bucket
502 WHERE owner = src_usr
504 suffix := ' (' || src_usr || ')';
507 UPDATE container.user_bucket
508 SET owner = dest_usr, name = name || suffix
509 WHERE id = renamable_row.id;
510 EXCEPTION WHEN unique_violation THEN
511 suffix := suffix || ' ';
518 DELETE FROM container.user_bucket_item WHERE target_user = src_usr;
521 DELETE FROM money.billable_xact WHERE usr = src_usr;
522 DELETE FROM money.collections_tracker WHERE usr = src_usr;
523 UPDATE money.collections_tracker SET collector = dest_usr WHERE collector = src_usr;
526 DELETE FROM permission.usr_grp_map WHERE usr = src_usr;
527 DELETE FROM permission.usr_object_perm_map WHERE usr = src_usr;
528 DELETE FROM permission.usr_perm_map WHERE usr = src_usr;
529 DELETE FROM permission.usr_work_ou_map WHERE usr = src_usr;
532 -- Update with a rename to avoid collisions
536 FROM reporter.output_folder
537 WHERE owner = src_usr
539 suffix := ' (' || src_usr || ')';
542 UPDATE reporter.output_folder
543 SET owner = dest_usr, name = name || suffix
544 WHERE id = renamable_row.id;
545 EXCEPTION WHEN unique_violation THEN
546 suffix := suffix || ' ';
552 EXCEPTION WHEN undefined_table THEN
557 UPDATE reporter.report SET owner = dest_usr WHERE owner = src_usr;
558 EXCEPTION WHEN undefined_table THEN
562 -- Update with a rename to avoid collisions
566 FROM reporter.report_folder
567 WHERE owner = src_usr
569 suffix := ' (' || src_usr || ')';
572 UPDATE reporter.report_folder
573 SET owner = dest_usr, name = name || suffix
574 WHERE id = renamable_row.id;
575 EXCEPTION WHEN unique_violation THEN
576 suffix := suffix || ' ';
582 EXCEPTION WHEN undefined_table THEN
587 UPDATE reporter.schedule SET runner = dest_usr WHERE runner = src_usr;
588 EXCEPTION WHEN undefined_table THEN
593 UPDATE reporter.template SET owner = dest_usr WHERE owner = src_usr;
594 EXCEPTION WHEN undefined_table THEN
598 -- Update with a rename to avoid collisions
602 FROM reporter.template_folder
603 WHERE owner = src_usr
605 suffix := ' (' || src_usr || ')';
608 UPDATE reporter.template_folder
609 SET owner = dest_usr, name = name || suffix
610 WHERE id = renamable_row.id;
611 EXCEPTION WHEN unique_violation THEN
612 suffix := suffix || ' ';
618 EXCEPTION WHEN undefined_table THEN
623 -- Update with a rename to avoid collisions
627 WHERE owner = src_usr
629 suffix := ' (' || src_usr || ')';
632 UPDATE vandelay.queue
633 SET owner = dest_usr, name = name || suffix
634 WHERE id = renamable_row.id;
635 EXCEPTION WHEN unique_violation THEN
636 suffix := suffix || ' ';
643 UPDATE vandelay.session_tracker SET usr = dest_usr WHERE usr = src_usr;
645 -- NULL-ify addresses last so other cleanup (e.g. circ anonymization)
646 -- can access the information before deletion.
650 mailing_address = NULL,
651 billing_address = NULL
657 COMMENT ON FUNCTION actor.usr_purge_data(INT, INT) IS $$
658 Finds rows dependent on a given row in actor.usr and either deletes them
659 or reassigns them to a different user.
664 SELECT evergreen.upgrade_deps_block_check('1146', :eg_version);
666 INSERT INTO config.org_unit_setting_type
667 (name, label, description, grp, datatype)
669 'circ.privacy_waiver',
670 oils_i18n_gettext('circ.privacy_waiver',
671 'Allow others to use patron account (privacy waiver)',
673 oils_i18n_gettext('circ.privacy_waiver',
674 'Add a note to a user account indicating that specified people are allowed to ' ||
675 'place holds, pick up holds, check out items, or view borrowing history for that user account',
676 'coust', 'description'),
683 SELECT evergreen.upgrade_deps_block_check('1147', :eg_version);
685 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
687 'eg.grid.admin.server.config.rule_age_hold_protect', 'gui', 'object',
689 'eg.grid.admin.server.config.rule_age_hold_protect',
690 'Grid Config: admin.server.config.rule_age_hold_protect',
694 'eg.grid.admin.server.asset.stat_cat_sip_fields', 'gui', 'object',
696 'eg.grid.admin.server.asset.stat_cat_sip_fields',
697 'Grid Config: admin.server.asset.stat_cat_sip_fields',
701 'eg.grid.admin.server.actor.stat_cat_sip_fields', 'gui', 'object',
703 'eg.grid.admin.server.actor.stat_cat_sip_fields',
704 'Grid Config: admin.server.actor.stat_cat_sip_fields',
708 'eg.grid.admin.server.authority.browse_axis', 'gui', 'object',
710 'eg.grid.admin.server.authority.browse_axis',
711 'Grid Config: admin.server.authority.browse_axis',
715 'eg.grid.admin.server.authority.control_set', 'gui', 'object',
717 'eg.grid.admin.server.authority.control_set',
718 'Grid Config: admin.server.authority.control_set',
722 'eg.grid.admin.server.authority.heading_field', 'gui', 'object',
724 'eg.grid.admin.server.authority.heading_field',
725 'Grid Config: admin.server.authority.heading_field',
729 'eg.grid.admin.server.authority.thesaurus', 'gui', 'object',
731 'eg.grid.admin.server.authority.thesaurus',
732 'Grid Config: admin.server.authority.thesaurus',
736 'eg.grid.admin.server.config.best_hold_order', 'gui', 'object',
738 'eg.grid.admin.server.config.best_hold_order',
739 'Grid Config: admin.server.config.best_hold_order',
743 'eg.grid.admin.server.config.billing_type', 'gui', 'object',
745 'eg.grid.admin.server.config.billing_type',
746 'Grid Config: admin.server.config.billing_type',
750 'eg.grid.admin.server.asset.call_number_prefix', 'gui', 'object',
752 'eg.grid.admin.server.asset.call_number_prefix',
753 'Grid Config: admin.server.asset.call_number_prefix',
757 'eg.grid.admin.server.asset.call_number_suffix', 'gui', 'object',
759 'eg.grid.admin.server.asset.call_number_suffix',
760 'Grid Config: admin.server.asset.call_number_suffix',
764 'eg.grid.admin.server.config.rule_circ_duration', 'gui', 'object',
766 'eg.grid.admin.server.config.rule_circ_duration',
767 'Grid Config: admin.server.config.rule_circ_duration',
771 'eg.grid.admin.server.config.circ_limit_group', 'gui', 'object',
773 'eg.grid.admin.server.config.circ_limit_group',
774 'Grid Config: admin.server.config.circ_limit_group',
778 'eg.grid.admin.server.config.circ_matrix_weights', 'gui', 'object',
780 'eg.grid.admin.server.config.circ_matrix_weights',
781 'Grid Config: admin.server.config.circ_matrix_weights',
785 'eg.grid.admin.server.config.rule_max_fine', 'gui', 'object',
787 'eg.grid.admin.server.config.rule_max_fine',
788 'Grid Config: admin.server.config.rule_max_fine',
792 'eg.grid.admin.server.config.circ_modifier', 'gui', 'object',
794 'eg.grid.admin.server.config.circ_modifier',
795 'Grid Config: admin.server.config.circ_modifier',
799 'eg.grid.admin.server.config.copy_status', 'gui', 'object',
801 'eg.grid.admin.server.config.copy_status',
802 'Grid Config: admin.server.config.copy_status',
806 'eg.grid.admin.server.config.floating_group', 'gui', 'object',
808 'eg.grid.admin.server.config.floating_group',
809 'Grid Config: admin.server.config.floating_group',
813 'eg.grid.admin.server.config.global_flag', 'gui', 'object',
815 'eg.grid.admin.server.config.global_flag',
816 'Grid Config: admin.server.config.global_flag',
820 'eg.grid.admin.server.config.hard_due_date', 'gui', 'object',
822 'eg.grid.admin.server.config.hard_due_date',
823 'Grid Config: admin.server.config.hard_due_date',
827 'eg.grid.admin.server.config.hold_matrix_weights', 'gui', 'object',
829 'eg.grid.admin.server.config.hold_matrix_weights',
830 'Grid Config: admin.server.config.hold_matrix_weights',
834 'eg.grid.admin.server.vandelay.match_set', 'gui', 'object',
836 'eg.grid.admin.server.vandelay.match_set',
837 'Grid Config: admin.server.vandelay.match_set',
841 'eg.grid.admin.server.config.coded_value_map', 'gui', 'object',
843 'eg.grid.admin.server.config.coded_value_map',
844 'Grid Config: admin.server.config.coded_value_map',
848 'eg.grid.admin.server.vandelay.import_bib_trash_group', 'gui', 'object',
850 'eg.grid.admin.server.vandelay.import_bib_trash_group',
851 'Grid Config: admin.server.vandelay.import_bib_trash_group',
855 'eg.grid.admin.server.config.record_attr_definition', 'gui', 'object',
857 'eg.grid.admin.server.config.record_attr_definition',
858 'Grid Config: admin.server.config.record_attr_definition',
862 'eg.grid.admin.server.config.metabib_class', 'gui', 'object',
864 'eg.grid.admin.server.config.metabib_class',
865 'Grid Config: admin.server.config.metabib_class',
869 'eg.grid.admin.server.config.metabib_field_ts_map', 'gui', 'object',
871 'eg.grid.admin.server.config.metabib_field_ts_map',
872 'Grid Config: admin.server.config.metabib_field_ts_map',
876 'eg.grid.admin.server.config.metabib_field', 'gui', 'object',
878 'eg.grid.admin.server.config.metabib_field',
879 'Grid Config: admin.server.config.metabib_field',
883 'eg.grid.admin.server.permission.perm_list', 'gui', 'object',
885 'eg.grid.admin.server.permission.perm_list',
886 'Grid Config: admin.server.permission.perm_list',
890 'eg.grid.admin.server.config.remote_account', 'gui', 'object',
892 'eg.grid.admin.server.config.remote_account',
893 'Grid Config: admin.server.config.remote_account',
897 'eg.grid.admin.server.config.sms_carrier', 'gui', 'object',
899 'eg.grid.admin.server.config.sms_carrier',
900 'Grid Config: admin.server.config.sms_carrier',
904 'eg.grid.admin.server.config.usr_activity_type', 'gui', 'object',
906 'eg.grid.admin.server.config.usr_activity_type',
907 'Grid Config: admin.server.config.usr_activity_type',
911 'eg.grid.admin.server.config.weight_assoc', 'gui', 'object',
913 'eg.grid.admin.server.config.weight_assoc',
914 'Grid Config: admin.server.config.weight_assoc',
918 'eg.grid.admin.server.config.z3950_index_field_map', 'gui', 'object',
920 'eg.grid.admin.server.config.z3950_index_field_map',
921 'Grid Config: admin.server.config.z3950_index_field_map',
925 'eg.grid.admin.server.config.z3950_source', 'gui', 'object',
927 'eg.grid.admin.server.config.z3950_source',
928 'Grid Config: admin.server.config.z3950_source',
936 SELECT evergreen.upgrade_deps_block_check('1148', :eg_version); -- csharp/gmcharlt
938 CREATE OR REPLACE FUNCTION actor.usr_delete(
943 old_profile actor.usr.profile%type;
944 old_home_ou actor.usr.home_ou%type;
945 new_profile actor.usr.profile%type;
946 new_home_ou actor.usr.home_ou%type;
948 new_dob actor.usr.dob%type;
951 id || '-PURGED-' || now(),
965 -- Quit if no such user
967 IF old_profile IS NULL THEN
971 perform actor.usr_purge_data( src_usr, dest_usr );
973 -- Find the root grp_tree and the root org_unit. This would be simpler if we
974 -- could assume that there is only one root. Theoretically, someday, maybe,
975 -- there could be multiple roots, so we take extra trouble to get the right ones.
982 permission.grp_ancestors( old_profile )
991 actor.org_unit_ancestors( old_home_ou )
995 -- Truncate date of birth
997 IF new_dob IS NOT NULL THEN
998 new_dob := date_trunc( 'year', new_dob );
1005 profile = new_profile,
1008 passwd = random()::text,
1013 FROM config.identification_type
1017 ident_value2 = NULL,
1018 net_access_level = DEFAULT,
1021 first_given_name = new_name,
1022 second_given_name = NULL,
1023 family_name = new_name,
1028 evening_phone = NULL,
1030 mailing_address = NULL,
1031 billing_address = NULL,
1032 home_ou = new_home_ou,
1035 master_account = DEFAULT,
1036 super_user = DEFAULT,
1041 claims_returned_count = DEFAULT,
1042 credit_forward_balance = DEFAULT,
1043 last_xact_id = DEFAULT,
1044 alert_message = NULL,
1045 create_date = now(),
1050 $$ LANGUAGE plpgsql;
1053 SELECT evergreen.upgrade_deps_block_check('1150', :eg_version);
1055 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
1057 'eg.grid.cat.vandelay.queue.bib', 'gui', 'object',
1059 'eg.grid.cat.vandelay.queue.bib',
1060 'Grid Config: Vandelay Bib Queue',
1064 'eg.grid.cat.vandelay.queue.authority', 'gui', 'object',
1066 'eg.grid.cat.vandelay.queue.authority',
1067 'Grid Config: Vandelay Authority Queue',
1071 'eg.grid.cat.vandelay.match_set.list', 'gui', 'object',
1073 'eg.grid.cat.vandelay.match_set.list',
1074 'Grid Config: Vandelay Match Sets',
1078 'eg.grid.cat.vandelay.match_set.quality', 'gui', 'object',
1080 'eg.grid.cat.vandelay.match_set.quality',
1081 'Grid Config: Vandelay Match Quality Metrics',
1085 'eg.grid.cat.vandelay.queue.items', 'gui', 'object',
1087 'eg.grid.cat.vandelay.queue.items',
1088 'Grid Config: Vandelay Queue Import Items',
1092 'eg.grid.cat.vandelay.queue.list.bib', 'gui', 'object',
1094 'eg.grid.cat.vandelay.queue.list.bib',
1095 'Grid Config: Vandelay Bib Queue List',
1099 'eg.grid.cat.vandelay.queue.bib.items', 'gui', 'object',
1101 'eg.grid.cat.vandelay.queue.bib.items',
1102 'Grid Config: Vandelay Bib Items',
1106 'eg.grid.cat.vandelay.queue.list.auth', 'gui', 'object',
1108 'eg.grid.cat.vandelay.queue.list.auth',
1109 'Grid Config: Vandelay Authority Queue List',
1113 'eg.grid.admin.vandelay.merge_profile', 'gui', 'object',
1115 'eg.grid.admin.vandelay.merge_profile',
1116 'Grid Config: Vandelay Merge Profiles',
1120 'eg.grid.admin.vandelay.bib_attr_definition', 'gui', 'object',
1122 'eg.grid.admin.vandelay.bib_attr_definition',
1123 'Grid Config: Vandelay Bib Record Attributes',
1127 'eg.grid.admin.vandelay.import_item_attr_definition', 'gui', 'object',
1129 'eg.grid.admin.vandelay.import_item_attr_definition',
1130 'Grid Config: Vandelay Import Item Attributes',
1139 SELECT evergreen.upgrade_deps_block_check('1151', :eg_version);
1141 INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
1143 'eg.cat.vandelay.import.templates', 'cat', 'object',
1145 'eg.cat.vandelay.import.templates',
1146 'Vandelay Import Form Templates',
1152 SELECT evergreen.upgrade_deps_block_check('1152', :eg_version);
1154 INSERT into config.org_unit_setting_type
1155 (name, datatype, grp, label, description)
1157 'ui.staff.angular_catalog.enabled', 'bool', 'gui',
1159 'ui.staff.angular_catalog.enabled',
1160 'GUI: Enable Experimental Angular Staff Catalog',
1164 'ui.staff.angular_catalog.enabled',
1165 'Display an entry point in the browser client for the ' ||
1166 'experimental Angular staff catalog.',
1167 'coust', 'description'
1173 SELECT evergreen.upgrade_deps_block_check('1153', :eg_version);
1175 UPDATE config.org_unit_setting_type
1176 SET label = oils_i18n_gettext(
1177 'webstaff.cat.label.left_label.left_margin'
1178 ,'Item Print Label - Left Margin for Spine Label'
1182 description = oils_i18n_gettext(
1183 'webstaff.cat.label.left_label.left_margin'
1184 ,'Set the default left margin for the item print Spine Label. Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1188 WHERE NAME = 'webstaff.cat.label.left_label.left_margin';
1190 UPDATE config.org_unit_setting_type
1191 SET label = oils_i18n_gettext(
1192 'webstaff.cat.label.right_label.left_margin'
1193 ,'Item Print Label - Left Margin for Pocket Label'
1197 description = oils_i18n_gettext(
1198 'webstaff.cat.label.right_label.left_margin'
1199 ,'Set the default left margin for the item print Pocket Label (or in other words, the desired space between the two labels). Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1203 WHERE NAME = 'webstaff.cat.label.right_label.left_margin';
1206 UPDATE config.org_unit_setting_type
1207 SET label = oils_i18n_gettext(
1208 'webstaff.cat.label.left_label.height'
1209 ,'Item Print Label - Height for Spine Label'
1213 description = oils_i18n_gettext(
1214 'webstaff.cat.label.left_label.height'
1215 ,'Set the default height for the item print Spine Label. Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1219 WHERE NAME = 'webstaff.cat.label.left_label.height';
1221 UPDATE config.org_unit_setting_type
1222 SET label = oils_i18n_gettext(
1223 'webstaff.cat.label.left_label.width'
1224 ,'Item Print Label - Width for Spine Label'
1228 description = oils_i18n_gettext(
1229 'webstaff.cat.label.left_label.width'
1230 ,'Set the default width for the item print Spine Label. Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1234 WHERE NAME = 'webstaff.cat.label.left_label.width';
1236 UPDATE config.org_unit_setting_type
1237 SET label = oils_i18n_gettext(
1238 'webstaff.cat.label.right_label.height'
1239 ,'Item Print Label - Height for Pocket Label'
1243 description = oils_i18n_gettext(
1244 'webstaff.cat.label.right_label.height'
1245 ,'Set the default height for the item print Pocket Label. Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1249 WHERE NAME = 'webstaff.cat.label.right_label.height';
1251 UPDATE config.org_unit_setting_type
1252 SET label = oils_i18n_gettext(
1253 'webstaff.cat.label.right_label.width'
1254 ,'Item Print Label - Width for Pocket Label'
1258 description = oils_i18n_gettext(
1259 'webstaff.cat.label.right_label.width'
1260 ,'Set the default width for the item print Pocket Label. Please include a unit of measurement that is valid CSS. For example, "1in" or "2.5cm"'
1264 WHERE NAME = 'webstaff.cat.label.right_label.width';
1267 SELECT evergreen.upgrade_deps_block_check('1155', :eg_version);
1269 CREATE OR REPLACE FUNCTION reporter.enable_materialized_simple_record_trigger () RETURNS VOID AS $$
1271 TRUNCATE TABLE reporter.materialized_simple_record;
1273 INSERT INTO reporter.materialized_simple_record
1274 (id,fingerprint,quality,tcn_source,tcn_value,title,author,publisher,pubdate,isbn,issn)
1275 SELECT DISTINCT ON (id) * FROM reporter.old_super_simple_record;
1277 CREATE TRIGGER bbb_simple_rec_trigger
1278 AFTER INSERT OR UPDATE OR DELETE ON biblio.record_entry
1279 FOR EACH ROW EXECUTE PROCEDURE reporter.simple_rec_trigger();
1285 SELECT evergreen.upgrade_deps_block_check('1156', :eg_version);
1287 ALTER TABLE reporter.template ALTER COLUMN description SET DEFAULT '';
1290 SELECT evergreen.upgrade_deps_block_check('1159', :eg_version);
1292 INSERT INTO config.marc_field(marc_format, marc_record_type, tag, name, description,
1293 fixed_field, repeatable, mandatory, hidden)
1294 VALUES (1, 'biblio', '758', $$Resource Identifier$$, $$An identifier for a resource that is either the resource described in the bibliographic record or a resource to which it is related. Resources thus identified may include, but are not limited to, FRBR works, expressions, manifestations, and items. The field does not prescribe a particular content standard or data model.$$,
1295 FALSE, TRUE, FALSE, FALSE);
1296 INSERT INTO config.record_attr_definition(name, label)
1297 VALUES ('marc21_biblio_758_ind_1', 'MARC 21 biblio field 758 indicator position 1');
1298 INSERT INTO config.coded_value_map(ctype, code, value, opac_visible, is_simple)
1299 VALUES ('marc21_biblio_758_ind_1', '#', $$Undefined$$, FALSE, TRUE);
1300 INSERT INTO config.record_attr_definition(name, label)
1301 VALUES ('marc21_biblio_758_ind_2', 'MARC 21 biblio field 758 indicator position 2');
1302 INSERT INTO config.coded_value_map(ctype, code, value, opac_visible, is_simple)
1303 VALUES ('marc21_biblio_758_ind_2', '#', $$Undefined$$, FALSE, TRUE);
1304 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1305 repeatable, mandatory, hidden)
1306 VALUES (1, 'biblio', '758', 'a', $$Label$$,
1307 FALSE, FALSE, FALSE);
1308 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1309 repeatable, mandatory, hidden)
1310 VALUES (1, 'biblio', '758', 'i', $$Relationship information$$,
1311 TRUE, FALSE, FALSE);
1312 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1313 repeatable, mandatory, hidden)
1314 VALUES (1, 'biblio', '758', '0', $$Authority record control number or standard number$$,
1315 TRUE, FALSE, FALSE);
1316 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1317 repeatable, mandatory, hidden)
1318 VALUES (1, 'biblio', '758', '1', $$Real World Object URI$$,
1319 TRUE, FALSE, FALSE);
1320 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1321 repeatable, mandatory, hidden)
1322 VALUES (1, 'biblio', '758', '3', $$Materials specified$$,
1323 FALSE, FALSE, FALSE);
1324 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1325 repeatable, mandatory, hidden)
1326 VALUES (1, 'biblio', '758', '4', $$Relationship$$,
1327 TRUE, FALSE, FALSE);
1328 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1329 repeatable, mandatory, hidden)
1330 VALUES (1, 'biblio', '758', '5', $$Institution to which field applies$$,
1331 FALSE, FALSE, FALSE);
1332 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1333 repeatable, mandatory, hidden)
1334 VALUES (1, 'biblio', '758', '6', $$Linkage$$,
1335 FALSE, FALSE, FALSE);
1336 INSERT INTO config.marc_subfield(marc_format, marc_record_type, tag, code, description,
1337 repeatable, mandatory, hidden)
1338 VALUES (1, 'biblio', '758', '8', $$Field link and sequence number$$,
1339 TRUE, FALSE, FALSE);