3 SELECT evergreen.upgrade_deps_block_check('1033', :eg_version);
5 -- correctly turn off browsing for subjectd|geograhic and
6 -- subject|temporal now that the *_browse versions exist. This is
7 -- a no-op in a database that was started at version 2.12.0.
8 UPDATE config.metabib_field
9 SET browse_field = FALSE
10 WHERE field_class = 'subject' AND name = 'geographic'
13 UPDATE config.metabib_field
14 SET browse_field = FALSE
15 WHERE field_class = 'subject' AND name = 'temporal'
19 select b.tag, idx.name
20 from authority.control_set_bib_field b
21 join authority.control_set_bib_field_metabib_field_map map on (b.id = map.bib_field)
22 join config.metabib_field idx on (map.metabib_field = idx.id)
25 -- and fix bib field mapping if necessasry
26 UPDATE authority.control_set_bib_field_metabib_field_map map
27 SET metabib_field = cmf.id
28 FROM config.metabib_field cmf
29 WHERE cmf.field_class = 'subject' AND cmf.name= 'temporal_browse'
30 AND map.bib_field IN (
32 FROM authority.control_set_bib_field b
33 JOIN authority.control_set_authority_field a
34 ON (b.authority_field = a.id)
37 AND map.metabib_field IN (
39 FROM config.metabib_field
40 WHERE field_class = 'subject' AND name = 'geographic_browse'
42 UPDATE authority.control_set_bib_field_metabib_field_map map
43 SET metabib_field = cmf.id
44 FROM config.metabib_field cmf
45 WHERE cmf.field_class = 'subject' AND cmf.name= 'geographic_browse'
46 AND map.bib_field IN (
48 FROM authority.control_set_bib_field b
49 JOIN authority.control_set_authority_field a
50 ON (b.authority_field = a.id)
53 AND map.metabib_field IN (
55 FROM config.metabib_field
56 WHERE field_class = 'subject' AND name = 'temporal_browse'
59 \qecho Verify that bib subject fields appear to be mapped to
60 \qecho to correct browse indexes
61 SELECT b.id, b.tag, idx.field_class, idx.name
62 FROM authority.control_set_bib_field b
63 JOIN authority.control_set_bib_field_metabib_field_map map ON (b.id = map.bib_field)
64 JOIN config.metabib_field idx ON (map.metabib_field = idx.id)
70 \qecho This is a browse-only reingest of your bib records. It may take a while.
71 \qecho You may cancel now without losing the effect of the rest of the
72 \qecho upgrade script, and arrange the reingest later.
74 SELECT metabib.reingest_metabib_field_entries(id, TRUE, FALSE, TRUE)
75 FROM biblio.record_entry;