]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/1026.data.subject_browse.sql
LP#1806968 Teach Vandelay to pass correct auth tracker type
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 1026.data.subject_browse.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('1026', :eg_version);
4
5 INSERT INTO config.metabib_field ( id, field_class, name, label, 
6      format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
7     (34, 'subject', 'topic_browse', oils_i18n_gettext(34, 'Topic Browse', 'cmf', 'label'), 
8      'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "topic"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
9
10 INSERT INTO config.metabib_field ( id, field_class, name, label, 
11      format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
12     (35, 'subject', 'geographic_browse', oils_i18n_gettext(35, 'Geographic Name Browse', 'cmf', 'label'), 
13      'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "geographic"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
14
15 INSERT INTO config.metabib_field ( id, field_class, name, label, 
16      format, xpath, search_field, browse_field, authority_xpath, joiner ) VALUES
17     (36, 'subject', 'temporal_browse', oils_i18n_gettext(36, 'Temporal Term Browse', 'cmf', 'label'), 
18      'mods32', $$//mods32:mods/mods32:subject[local-name(./*[1]) = "temporal"]$$, FALSE, TRUE, '//@xlink:href', ' -- ' ); -- /* to fool vim */;
19
20 INSERT INTO config.metabib_field_index_norm_map (field,norm)
21     SELECT  m.id,
22             i.id
23       FROM  config.metabib_field m,
24         config.index_normalizer i
25       WHERE i.func IN ('naco_normalize')
26             AND m.id IN (34, 35, 36);
27
28 UPDATE config.metabib_field
29 SET browse_field = FALSE
30 WHERE field_class = 'subject' AND name = 'topic'
31 AND id = 14;
32 UPDATE config.metabib_field
33 SET browse_field = FALSE
34 WHERE field_class = 'subject' AND name = 'geographic'
35 AND id = 13;
36 UPDATE config.metabib_field
37 SET browse_field = FALSE
38 WHERE field_class = 'subject' AND name = 'temporal'
39 AND id = 11;
40
41 UPDATE authority.control_set_bib_field_metabib_field_map
42 SET metabib_field = 34
43 WHERE metabib_field = 14;
44 UPDATE authority.control_set_bib_field_metabib_field_map
45 SET metabib_field = 35
46 WHERE metabib_field = 13;
47 UPDATE authority.control_set_bib_field_metabib_field_map
48 SET metabib_field = 36
49 WHERE metabib_field = 11;
50
51 COMMIT;
52
53 \qecho This is a browse-only reingest of your bib records. It may take a while.
54 \qecho You may cancel now without losing the effect of the rest of the
55 \qecho upgrade script, and arrange the reingest later.
56 \qecho .
57 SELECT metabib.reingest_metabib_field_entries(id, TRUE, FALSE, TRUE)
58     FROM biblio.record_entry;