Add new patch to include new synonyms for Swaziland

This commit is contained in:
Mario de Frutos 2018-10-11 17:23:24 +02:00
parent 4fdf9490e3
commit 8920403fbd
3 changed files with 12 additions and 1 deletions

1
geocoder/.gitignore vendored
View File

@ -1 +1,2 @@
db_dumps/
data_patches/

View File

@ -0,0 +1,9 @@
DO $$
DECLARE updated INTEGER;
BEGIN
SELECT count(*) FROM admin0_synonyms WHERE adm0_a3 = 'SWZ' GROUP BY adm0_a3 HAVING count(*) > 0 INTO updated;
IF updated = 4 THEN
INSERT INTO admin0_synonyms (name, rank, adm0_a3, name_) SELECT 'Eswatini' as name, 6, adm0_a3, 'eswatini' as name_ FROM admin0_synonyms WHERE name_ = 'swaziland';
INSERT INTO admin0_synonyms (name, rank, adm0_a3, name_) SELECT 'Kingdom of Eswatini' as name, 7, adm0_a3, 'kingdomofeswatini' as name_ FROM admin0_synonyms WHERE name_ = 'swaziland';
END IF;
END$$;

View File

@ -8,7 +8,8 @@ PATCHES_LIST="20160203_countries_bh_isocode.sql
20160622_countries_synonym_congo.sql
20171004_merge_corsica_and_france.sql
20180117_hsinchu_synonyms.sql
20180306_add_ssd_rows_for_south_sudan.sql"
20180306_add_ssd_rows_for_south_sudan.sql
20181011_add_synonyms_for_swaziland.sql"
mkdir -p $TARGET_DIR_PATCHES