]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/XXXX.all_video_search_format.sql
LP#1917826: add release notes entry
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / XXXX.all_video_search_format.sql
1 BEGIN;
2
3 -- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
4
5 INSERT INTO config.coded_value_map
6     (id, ctype, code, opac_visible, value, search_label)
7     SELECT 1738,'search_format','video', true,
8     oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'value'),
9     oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'search_label')
10     WHERE NOT EXISTS (
11         SELECT 1 FROM config.coded_value_map WHERE id=1738
12         OR value = 'All Videos' OR search_label = 'All Videos'
13     );
14
15 INSERT INTO config.composite_attr_entry_definition (coded_value, definition)
16     SELECT 1738, '{"_attr":"item_type","_val":"g"}'
17 WHERE NOT EXISTS (
18     SELECT 1 FROM config.composite_attr_entry_definition WHERE coded_value = 1738
19 );
20
21 COMMIT;
22
23 \qecho
24 \qecho This is a partial record attribute reingest of your bib records.
25 \qecho It may take a while.
26 \qecho You may cancel now without losing the effect of the rest of the
27 \qecho upgrade script, and arrange the reingest later.
28 SELECT COUNT(metabib.reingest_record_attributes(bre.id))
29     FROM biblio.record_entry bre
30     JOIN metabib.record_attr_flat mraf ON (bre.id = mraf.id)
31     WHERE deleted IS FALSE
32     AND attr = 'item_type'
33     AND value = 'g';