more SQL fixes
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 13 Jun 2017 20:52:37 +0000 (20:52 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 13 Jun 2017 20:52:37 +0000 (20:52 +0000)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/YYYY.schema.thesauri.sql

index b2d3867..440a609 100644 (file)
@@ -17231,7 +17231,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';
@@ -17247,9 +17247,9 @@ UPDATE  authority.thesaurus
   WHERE short_code IS NULL;
 
 INSERT INTO config.i18n_core (fq_field, identity_value, translation, string )
-  SELECT  'at.name', t.code, each.key, each.value
+  SELECT  'at.name', t.code, (xlate).key, (xlate).value
     FROM  thesauri t,
-          JOIN LATERAL each(t.xlate) ON TRUE
+          JOIN LATERAL each(t.xlate) AS xlate ON TRUE
     WHERE NOT EXISTS
             (SELECT id
               FROM  config.i18n_core
index cd4875a..84566cb 100644 (file)
@@ -428,9 +428,9 @@ UPDATE  authority.thesaurus
         AND control_set = 1;
 
 INSERT INTO config.i18n_core (fq_field, identity_value, translation, string )
-  SELECT  'at.name', t.code, each.key, each.value
+  SELECT  'at.name', t.code, (xlate).key, (xlate).value
     FROM  thesauri t,
-          JOIN LATERAL each(t.xlate) ON TRUE
+          JOIN LATERAL each(t.xlate) AS xlate ON TRUE
     WHERE NOT EXISTS
             (SELECT id
               FROM  config.i18n_core