Add new SQL patch adding aliases for 'North Macedonia'

This commit is contained in:
cgonzalez 2021-01-18 17:48:36 +00:00
parent af848aa65b
commit 5e16c16275
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,9 @@
DO $$
DECLARE updated INTEGER;
BEGIN
SELECT count(*) FROM admin0_synonyms WHERE adm0_a3 = 'MKD' GROUP BY adm0_a3 HAVING count(*) > 0 INTO updated;
IF updated = 6 THEN
INSERT INTO admin0_synonyms (name, rank, adm0_a3, name_) SELECT 'North Macedonia' as name, 6, adm0_a3, 'northmacedonia' as name_ FROM admin0_synonyms WHERE name_ = 'macedonia';
INSERT INTO admin0_synonyms (name, rank, adm0_a3, name_) SELECT 'Republic of North Macedonia' as name, 7, adm0_a3, 'republicofnorthmacedonia' as name_ FROM admin0_synonyms WHERE name_ = 'macedonia';
END IF;
END$$;

View File

@ -10,7 +10,8 @@ PATCHES_LIST="20160203_countries_bh_isocode.sql
20180117_hsinchu_synonyms.sql
20180306_add_ssd_rows_for_south_sudan.sql
20181011_add_synonyms_for_swaziland.sql
20190111_france_regions_typos.sql"
20190111_france_regions_typos.sql
20210118_add_renamed_country_north_macedonia.sql"
mkdir -p $TARGET_DIR_PATCHES