BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0569', :eg_version); -- miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0yyy', :eg_version); -- senator
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('item_type','Type','Type');
INSERT INTO config.record_attr_definition (name,label,phys_char_sf) values ('vr_format','Videorecording format',72);
INSERT INTO config.record_attr_definition (name,label,sorter,filter,tag) values ('titlesort','Title',TRUE,FALSE,'tnf');
-INSERT INTO config.record_attr_definition (name,label,sorter,filter,tag) values ('authorsort','Author',TRUE,FALSE,'1%');
+INSERT INTO config.record_attr_definition (name,label,sorter,filter,tag,sf_list) values ('authorsort','Author',TRUE,FALSE,'1%','abcdefgklmnopqrstvxyz');
-- TO-DO: Auto-generate these values from CLDR
-- XXX These are the values used in MARC records ... does that match CLDR, including deprecated languages?
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0yyy', :eg_version);
+
+-- Not everything in 1XX tags should become part of the authorsort field
+-- ($0 for example). The list of subfields chosen here is a superset of all
+-- the fields found in the LoC authority mappin definitions for 1XX fields.
+-- Anyway, if more fields should be here, add them.
+
+UPDATE config.record_attr_definition
+ SET sf_list = 'abcdefgklmnopqrstvxyz'
+ WHERE name='authorsort' AND sf_list IS NULL;
+
+COMMIT;