From 2e6316cdaf0f36f73d8a3bad7930686e94895bb6 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 27 Jul 2017 20:21:29 +0000 Subject: [PATCH] thesaurus upgrade script fixes Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql index 84566cbbd8..53a91336e0 100644 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql +++ b/Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE TRIGGER thes_code_tracking_trigger - AFTER UPDATE ON authority.thesaurus - FOR EACH ROW EXECUTE PROCEDURE oils_i18n_code_tracking('at'); +--CREATE TRIGGER thes_code_tracking_trigger + --AFTER UPDATE ON authority.thesaurus + --FOR EACH ROW EXECUTE PROCEDURE oils_i18n_code_tracking('at'); -ALTER TABLE authority.thesaurus ADD COLUMN short_code TEXT, uri TEXT; +--ALTER TABLE authority.thesaurus ADD COLUMN short_code TEXT, uri TEXT; DELETE FROM authority.thesaurus WHERE control_set = 1 AND code NOT IN ('n',' ','|'); UPDATE authority.thesaurus SET short_code = code; @@ -216,7 +216,6 @@ ccsa http://id.loc.gov/vocabulary/subjectSchemes/ccsa Catalogue collectif suisse noraf http://id.loc.gov/vocabulary/subjectSchemes/noraf Norwegian Authority File kito http://id.loc.gov/vocabulary/subjectSchemes/kito KITO - Kirjallisuudentutkimuksen ontologia "fi"=>"KITO - Kirjallisuudentutkimuksen ontologia" tho http://id.loc.gov/vocabulary/subjectSchemes/tho Thesauros Hellēnikōn Oron "el"=>"Thesauros Hellēnikōn Oron" -ept http://id.loc.gov/vocabulary/subjectSchemes/ept European education thesaurus "sl"=>"Evropski pedagoški tezaver" pmont http://id.loc.gov/vocabulary/subjectSchemes/pmont Powerhouse Museum Object Name Thesaurus ssg http://id.loc.gov/vocabulary/subjectSchemes/ssg Splošni slovenski geslovnik "sl"=>"Splošni slovenski geslovnik" huc http://id.loc.gov/vocabulary/subjectSchemes/huc U.S. Geological Survey water-supply paper 2294: hydrologic basins unit codes @@ -244,7 +243,6 @@ snt http://id.loc.gov/vocabulary/subjectSchemes/snt Sexual nomenclature : a thes francis http://id.loc.gov/vocabulary/subjectSchemes/francis FRANCIS database classification scheme "fr"=>"Base de donneés FRANCIS: plan de classement" eurovocsl http://id.loc.gov/vocabulary/subjectSchemes/eurovocsl Eurovoc thesaurus "sl"=>"Eurovoc thesaurus" idszbzes http://id.loc.gov/vocabulary/subjectSchemes/idszbzes Thesaurus IDS Nebis Bibliothek Englisches Seminar der Universität Zürich "de"=>"Thesaurus IDS Nebis Bibliothek Englisches Seminar der Universität Zürich" -gnd http://id.loc.gov/vocabulary/subjectSchemes/gnd Gemeinsame Normdatei "de"=>"Gemeinsame Normdatei" nlmnaf http://id.loc.gov/vocabulary/subjectSchemes/nlmnaf National Library of Medicine name authority file rugeo http://id.loc.gov/vocabulary/subjectSchemes/rugeo Natsional'nyi normativnyi fail geograficheskikh nazvanii Rossiiskoi Federatsii "ru"=>"Natsional'nyi normativnyi fail geograficheskikh nazvanii Rossiiskoi Federatsii" sipri http://id.loc.gov/vocabulary/subjectSchemes/sipri SIPRI library thesaurus @@ -411,7 +409,7 @@ csht http://id.loc.gov/vocabulary/subjectSchemes/csht Chinese subject headings -- ' ...blah INSERT INTO authority.thesaurus (code, uri, name, control_set) - SELECT code, uri, name, 1 FROM thesausi; + SELECT code, uri, name, 1 FROM thesauri; UPDATE authority.thesaurus SET short_code = 'a' WHERE code = 'lcsh'; UPDATE authority.thesaurus SET short_code = 'b' WHERE code = 'lcshac'; @@ -428,17 +426,17 @@ UPDATE authority.thesaurus AND control_set = 1; INSERT INTO config.i18n_core (fq_field, identity_value, translation, string ) - SELECT 'at.name', t.code, (xlate).key, (xlate).value - FROM thesauri t, + SELECT 'at.name', t.code, xlate->key, xlate->value + FROM thesauri t JOIN LATERAL each(t.xlate) AS xlate ON TRUE WHERE NOT EXISTS (SELECT id FROM config.i18n_core WHERE fq_field = 'at.name' AND identity_value = t.code - AND translation = each.key) + AND translation = xlate->key) AND t.xlate IS NOT NULL - AND t.name <> each.value; + AND t.name <> (xlate->value); CREATE OR REPLACE FUNCTION authority.extract_thesaurus( marcxml TEXT ) RETURNS TEXT AS $func$ DECLARE -- 2.11.0