INSERT INTO authority.control_set_authority_field (id, control_set, main_entry, tag, sf_list, display_sf_list, name) VALUES
-- Main entries
- (1, 1, NULL, '100', 'abcdefklmnopqrstvxyz', 'abcdefklmnopqrstvxyz',
+ (1, 1, NULL, '100', 'abcdfklmnopqrstvxyz', 'abcdefklmnopqrstvxyz',
oils_i18n_gettext('1','Heading -- Personal Name','acsaf','name')),
- (2, 1, NULL, '110', 'abcdefgklmnoprstvxyz', 'abcdefgklmnoprstvxyz',
+ (2, 1, NULL, '110', 'abcdfgklmnoprstvxyz', 'abcdefgklmnoprstvxyz',
oils_i18n_gettext('2','Heading -- Corporate Name','acsaf','name')),
(3, 1, NULL, '111', 'acdefgklnpqstvxyz', 'acdefgklnpqstvxyz',
oils_i18n_gettext('3','Heading -- Meeting Name','acsaf','name')),
--- /dev/null
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(2);
+
+-- Run the tests.
+SELECT is(
+ (SELECT sf_list FROM authority.control_set_authority_field WHERE tag = '100') ,
+ 'abcdfklmnopqrstvxyz',
+ 'verify that subfield "e" has been removed'
+);
+
+SELECT is(
+ (SELECT sf_list FROM authority.control_set_authority_field WHERE tag = '110') ,
+ 'abcdfgklmnoprstvxyz',
+ 'verify that subfield "e" has been removed'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
\ No newline at end of file
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('XXXX');
+
+-- TODO: ask community if I should be warnign users that my code only fixes 100 & 110 auth tags for default (id=1) control set
+
+UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '100' AND control_set = 1 AND sf_list ILIKE '%e%';
+
+UPDATE authority.control_set_authority_field SET sf_list = REGEXP_REPLACE( sf_list, 'e', '', 'i') WHERE tag = '110' AND control_set = 1 AND sf_list ILIKE '%e%';
+
+COMMIT;