From: Galen Charlton Date: Wed, 16 Nov 2016 16:56:16 +0000 (-0500) Subject: LP#1618183: make upgrade not die if es-ES locale already exists X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=343f21c7aa2df3bb7f5d40ddff27e3a7a9921aaa;p=evergreen%2Fpines.git LP#1618183: make upgrade not die if es-ES locale already exists Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/upgrade/1000.data.add-spanish-to-i18n-locale.sql b/Open-ILS/src/sql/Pg/upgrade/1000.data.add-spanish-to-i18n-locale.sql index b221170fba..c1bcfc13c4 100644 --- a/Open-ILS/src/sql/Pg/upgrade/1000.data.add-spanish-to-i18n-locale.sql +++ b/Open-ILS/src/sql/Pg/upgrade/1000.data.add-spanish-to-i18n-locale.sql @@ -5,7 +5,8 @@ BEGIN; SELECT evergreen.upgrade_deps_block_check('1000', :eg_version); INSERT INTO config.i18n_locale (code,marc_code,name,description) - VALUES ('es-ES', 'spa', oils_i18n_gettext('es-ES', 'Spanish', 'i18n_l', 'name'), - oils_i18n_gettext('es-ES', 'Spanish', 'i18n_l', 'description')); + SELECT 'es-ES', 'spa', oils_i18n_gettext('es-ES', 'Spanish', 'i18n_l', 'name'), + oils_i18n_gettext('es-ES', 'Spanish', 'i18n_l', 'description') + WHERE NOT EXISTS (SELECT 1 FROM config.i18n_locale WHERE code = 'es-ES'); COMMIT;