INSERT INTO config.coded_value_map (id, ctype, code, value, opac_visible) VALUES (1733, 'ills4', 'o', oils_i18n_gettext('1733', 'Photographs', 'ccvm', 'value'), FALSE);
INSERT INTO config.coded_value_map (id, ctype, code, value, opac_visible) VALUES (1734, 'ills4', 'p', oils_i18n_gettext('1734', 'Illuminations', 'ccvm', 'value'), FALSE);
+INSERT INTO config.coded_value_map (id,ctype,code,opac_visible,is_simple,value,search_label) VALUES
+(1736,'icon_format','preloadedaudio',TRUE,FALSE,
+ oils_i18n_gettext(1736, 'Preloaded Audio', 'ccvm', 'value'),
+ oils_i18n_gettext(1736, 'Preloaded Audio', 'ccvm', 'search_label')),
+(1737,'search_format','preloadedaudio',TRUE,FALSE,
+ oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'value'),
+ oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'search_label'))
+;
-- carve out a slot of 10k IDs for stock CCVMs
SELECT SETVAL('config.coded_value_map_id_seq'::TEXT, 10000);
INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES (1672, '[{"_attr":"ills4","_val":"o"},{"_attr":"ills3","_val":"o"},{"_attr":"ills2","_val":"o"},{"_attr":"ills1","_val":"o"}]');
INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES (1673, '[{"_attr":"ills4","_val":"p"},{"_attr":"ills3","_val":"p"},{"_attr":"ills2","_val":"p"},{"_attr":"ills1","_val":"p"}]');
-
+--preloaded audio
+INSERT INTO config.composite_attr_entry_definition (id, coded_value, definition) VALUES
+(1674,(SELECT id from config.coded_value_map where ctype = 'search_format' AND code = 'preloadedaudio'),'{"0":{"_attr":"item_type","_val":"i"},"1":{"_attr":"item_form","_val":"q"}}'),
+(1675,(SELECT id from config.coded_value_map where ctype = 'icon_format' AND code = 'preloadedaudio'),'{"0":{"_attr":"item_type","_val":"i"},"1":{"_attr":"item_form","_val":"q"}}');
-- Trigger Event Definitions -------------------------------------------------
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
+
+INSERT INTO config.coded_value_map (id,ctype,code,opac_visible,is_simple,value,search_label) VALUES
+(1736,'icon_format','preloadedaudio',TRUE,FALSE,
+ oils_i18n_gettext(1736, 'Preloaded Audio', 'ccvm', 'value'),
+ oils_i18n_gettext(1736, 'Preloaded Audio', 'ccvm', 'search_label')),
+(1737,'search_format','preloadedaudio',TRUE,FALSE,
+ oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'value'),
+ oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'search_label'))
+;
+
+INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES
+((SELECT id from config.coded_value_map where ctype = 'search_format' AND code = 'preloadedaudio'),'{"0":{"_attr":"item_type","_val":"i"},"1":{"_attr":"item_form","_val":"q"}}'),
+((SELECT id from config.coded_value_map where ctype = 'icon_format' AND code = 'preloadedaudio'),'{"0":{"_attr":"item_type","_val":"i"},"1":{"_attr":"item_form","_val":"q"}}');
+
+
+COMMIT;
--- /dev/null
+Preloaded Audio Icon and Search Format
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+A new search and icon format called Preloaded Audio now exists
+that overlaps with the eAudio format. If you want to exclude
+the Preloaded Audio format from overlapping with eAudio
+you can use the following SQL:
+
+UPDATE config.composite_attr_entry_definition SET definition = '{"0":{"_attr":"item_type","_val":"i"},"1":[{"_attr":"item_form","_val":"o"},{"_attr":"item_form","_val":"s"}]}'
+ WHERE coded_value IN (SELECT id FROM config.coded_value_map WHERE code = 'eaudio');
+
+It is also recommended that you reingest your bibliographic records
+to updated the fixed field indexes. You can accomplish this by running
+the following query in your database:
+
+SELECT metabib.reingest_record_attributes(source)
+FROM metabib.record_attr_vector_list WHERE
+(SELECT id FROM config.coded_value_map WHERE ctype = 'item_form' AND code = 'q') = ANY(vlist)
+AND (SELECT id FROM config.coded_value_map WHERE ctype = 'item_type' AND code = 'i') = ANY(vlist);
+
+