From 8a65cdf711e8874ab98b269c95bde65617d871ad Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 11 May 2016 14:29:55 -0400 Subject: [PATCH] Remove country names and code3s from database We're using names from the Babel library, and we're not using code3. --- sql/branch.sql | 4 +- sql/countries.sql | 277 +++++----------------------------------------- 2 files changed, 27 insertions(+), 254 deletions(-) diff --git a/sql/branch.sql b/sql/branch.sql index a4c2fa3987..db21a9e946 100644 --- a/sql/branch.sql +++ b/sql/branch.sql @@ -1,8 +1,6 @@ CREATE TABLE countries -- http://www.iso.org/iso/country_codes ( id bigserial primary key -, code2 text NOT NULL UNIQUE -, code3 text NOT NULL UNIQUE -, name text NOT NULL UNIQUE +, code text NOT NULL UNIQUE ); \i sql/countries.sql diff --git a/sql/countries.sql b/sql/countries.sql index 047522c519..e418cca21f 100644 --- a/sql/countries.sql +++ b/sql/countries.sql @@ -1,253 +1,28 @@ -- scraped from https://www.iso.org/obp/ui/#search -INSERT INTO countries - (code2, code3, name) - VALUES ('AD', 'AND', 'Andorra') - , ('AE', 'ARE', 'United Arab Emirates (the)') - , ('AF', 'AFG', 'Afghanistan') - , ('AG', 'ATG', 'Antigua and Barbuda') - , ('AI', 'AIA', 'Anguilla') - , ('AL', 'ALB', 'Albania') - , ('AM', 'ARM', 'Armenia') - , ('AO', 'AGO', 'Angola') - , ('AQ', 'ATA', 'Antarctica') - , ('AR', 'ARG', 'Argentina') - , ('AS', 'ASM', 'American Samoa') - , ('AT', 'AUT', 'Austria') - , ('AU', 'AUS', 'Australia') - , ('AW', 'ABW', 'Aruba') - , ('AX', 'ALA', 'Åland Islands') - , ('AZ', 'AZE', 'Azerbaijan') - , ('BA', 'BIH', 'Bosnia and Herzegovina') - , ('BB', 'BRB', 'Barbados') - , ('BD', 'BGD', 'Bangladesh') - , ('BE', 'BEL', 'Belgium') - , ('BF', 'BFA', 'Burkina Faso') - , ('BG', 'BGR', 'Bulgaria') - , ('BH', 'BHR', 'Bahrain') - , ('BI', 'BDI', 'Burundi') - , ('BJ', 'BEN', 'Benin') - , ('BL', 'BLM', 'Saint Barthélemy') - , ('BM', 'BMU', 'Bermuda') - , ('BN', 'BRN', 'Brunei Darussalam') - , ('BO', 'BOL', 'Bolivia (Plurinational State of)') - , ('BQ', 'BES', 'Bonaire, Sint Eustatius and Saba') - , ('BR', 'BRA', 'Brazil') - , ('BS', 'BHS', 'Bahamas (the)') - , ('BT', 'BTN', 'Bhutan') - , ('BV', 'BVT', 'Bouvet Island') - , ('BW', 'BWA', 'Botswana') - , ('BY', 'BLR', 'Belarus') - , ('BZ', 'BLZ', 'Belize') - , ('CA', 'CAN', 'Canada') - , ('CC', 'CCK', 'Cocos (Keeling) Islands (the)') - , ('CD', 'COD', 'Congo (the Democratic Republic of the)') - , ('CF', 'CAF', 'Central African Republic (the)') - , ('CG', 'COG', 'Congo (the)') - , ('CH', 'CHE', 'Switzerland') - , ('CI', 'CIV', 'Côte dIvoire') - , ('CK', 'COK', 'Cook Islands (the)') - , ('CL', 'CHL', 'Chile') - , ('CM', 'CMR', 'Cameroon') - , ('CN', 'CHN', 'China') - , ('CO', 'COL', 'Colombia') - , ('CR', 'CRI', 'Costa Rica') - , ('CU', 'CUB', 'Cuba') - , ('CV', 'CPV', 'Cabo Verde') - , ('CW', 'CUW', 'Curaçao') - , ('CX', 'CXR', 'Christmas Island') - , ('CY', 'CYP', 'Cyprus') - , ('CZ', 'CZE', 'Czech Republic (the)') - , ('DE', 'DEU', 'Germany') - , ('DJ', 'DJI', 'Djibouti') - , ('DK', 'DNK', 'Denmark') - , ('DM', 'DMA', 'Dominica') - , ('DO', 'DOM', 'Dominican Republic (the)') - , ('DZ', 'DZA', 'Algeria') - , ('EC', 'ECU', 'Ecuador') - , ('EE', 'EST', 'Estonia') - , ('EG', 'EGY', 'Egypt') - , ('EH', 'ESH', 'Western Sahara*') - , ('ER', 'ERI', 'Eritrea') - , ('ES', 'ESP', 'Spain') - , ('ET', 'ETH', 'Ethiopia') - , ('FI', 'FIN', 'Finland') - , ('FJ', 'FJI', 'Fiji') - , ('FK', 'FLK', 'Falkland Islands (the) [Malvinas]') - , ('FM', 'FSM', 'Micronesia (Federated States of)') - , ('FO', 'FRO', 'Faroe Islands (the)') - , ('FR', 'FRA', 'France') - , ('GA', 'GAB', 'Gabon') - , ('GB', 'GBR', 'United Kingdom of Great Britain and Northern Ireland (the)') - , ('GD', 'GRD', 'Grenada') - , ('GE', 'GEO', 'Georgia') - , ('GF', 'GUF', 'French Guiana') - , ('GG', 'GGY', 'Guernsey') - , ('GH', 'GHA', 'Ghana') - , ('GI', 'GIB', 'Gibraltar') - , ('GL', 'GRL', 'Greenland') - , ('GM', 'GMB', 'Gambia (the)') - , ('GN', 'GIN', 'Guinea') - , ('GP', 'GLP', 'Guadeloupe') - , ('GQ', 'GNQ', 'Equatorial Guinea') - , ('GR', 'GRC', 'Greece') - , ('GS', 'SGS', 'South Georgia and the South Sandwich Islands') - , ('GT', 'GTM', 'Guatemala') - , ('GU', 'GUM', 'Guam') - , ('GW', 'GNB', 'Guinea-Bissau') - , ('GY', 'GUY', 'Guyana') - , ('HK', 'HKG', 'Hong Kong') - , ('HM', 'HMD', 'Heard Island and McDonald Islands') - , ('HN', 'HND', 'Honduras') - , ('HR', 'HRV', 'Croatia') - , ('HT', 'HTI', 'Haiti') - , ('HU', 'HUN', 'Hungary') - , ('ID', 'IDN', 'Indonesia') - , ('IE', 'IRL', 'Ireland') - , ('IL', 'ISR', 'Israel') - , ('IM', 'IMN', 'Isle of Man') - , ('IN', 'IND', 'India') - , ('IO', 'IOT', 'British Indian Ocean Territory (the)') - , ('IQ', 'IRQ', 'Iraq') - , ('IR', 'IRN', 'Iran (Islamic Republic of)') - , ('IS', 'ISL', 'Iceland') - , ('IT', 'ITA', 'Italy') - , ('JE', 'JEY', 'Jersey') - , ('JM', 'JAM', 'Jamaica') - , ('JO', 'JOR', 'Jordan') - , ('JP', 'JPN', 'Japan') - , ('KE', 'KEN', 'Kenya') - , ('KG', 'KGZ', 'Kyrgyzstan') - , ('KH', 'KHM', 'Cambodia') - , ('KI', 'KIR', 'Kiribati') - , ('KM', 'COM', 'Comoros (the)') - , ('KN', 'KNA', 'Saint Kitts and Nevis') - , ('KP', 'PRK', 'Korea (the Democratic Peoples Republic of)') - , ('KR', 'KOR', 'Korea (the Republic of)') - , ('KW', 'KWT', 'Kuwait') - , ('KY', 'CYM', 'Cayman Islands (the)') - , ('KZ', 'KAZ', 'Kazakhstan') - , ('LA', 'LAO', 'Lao Peoples Democratic Republic (the)') - , ('LB', 'LBN', 'Lebanon') - , ('LC', 'LCA', 'Saint Lucia') - , ('LI', 'LIE', 'Liechtenstein') - , ('LK', 'LKA', 'Sri Lanka') - , ('LR', 'LBR', 'Liberia') - , ('LS', 'LSO', 'Lesotho') - , ('LT', 'LTU', 'Lithuania') - , ('LU', 'LUX', 'Luxembourg') - , ('LV', 'LVA', 'Latvia') - , ('LY', 'LBY', 'Libya') - , ('MA', 'MAR', 'Morocco') - , ('MC', 'MCO', 'Monaco') - , ('MD', 'MDA', 'Moldova (the Republic of)') - , ('ME', 'MNE', 'Montenegro') - , ('MF', 'MAF', 'Saint Martin (French part)') - , ('MG', 'MDG', 'Madagascar') - , ('MH', 'MHL', 'Marshall Islands (the)') - , ('MK', 'MKD', 'Macedonia (the former Yugoslav Republic of)') - , ('ML', 'MLI', 'Mali') - , ('MM', 'MMR', 'Myanmar') - , ('MN', 'MNG', 'Mongolia') - , ('MO', 'MAC', 'Macao') - , ('MP', 'MNP', 'Northern Mariana Islands (the)') - , ('MQ', 'MTQ', 'Martinique') - , ('MR', 'MRT', 'Mauritania') - , ('MS', 'MSR', 'Montserrat') - , ('MT', 'MLT', 'Malta') - , ('MU', 'MUS', 'Mauritius') - , ('MV', 'MDV', 'Maldives') - , ('MW', 'MWI', 'Malawi') - , ('MX', 'MEX', 'Mexico') - , ('MY', 'MYS', 'Malaysia') - , ('MZ', 'MOZ', 'Mozambique') - , ('NA', 'NAM', 'Namibia') - , ('NC', 'NCL', 'New Caledonia') - , ('NE', 'NER', 'Niger (the)') - , ('NF', 'NFK', 'Norfolk Island') - , ('NG', 'NGA', 'Nigeria') - , ('NI', 'NIC', 'Nicaragua') - , ('NL', 'NLD', 'Netherlands (the)') - , ('NO', 'NOR', 'Norway') - , ('NP', 'NPL', 'Nepal') - , ('NR', 'NRU', 'Nauru') - , ('NU', 'NIU', 'Niue') - , ('NZ', 'NZL', 'New Zealand') - , ('OM', 'OMN', 'Oman') - , ('PA', 'PAN', 'Panama') - , ('PE', 'PER', 'Peru') - , ('PF', 'PYF', 'French Polynesia') - , ('PG', 'PNG', 'Papua New Guinea') - , ('PH', 'PHL', 'Philippines (the)') - , ('PK', 'PAK', 'Pakistan') - , ('PL', 'POL', 'Poland') - , ('PM', 'SPM', 'Saint Pierre and Miquelon') - , ('PN', 'PCN', 'Pitcairn') - , ('PR', 'PRI', 'Puerto Rico') - , ('PS', 'PSE', 'Palestine, State of') - , ('PT', 'PRT', 'Portugal') - , ('PW', 'PLW', 'Palau') - , ('PY', 'PRY', 'Paraguay') - , ('QA', 'QAT', 'Qatar') - , ('RE', 'REU', 'Réunion') - , ('RO', 'ROU', 'Romania') - , ('RS', 'SRB', 'Serbia') - , ('RU', 'RUS', 'Russian Federation (the)') - , ('RW', 'RWA', 'Rwanda') - , ('SA', 'SAU', 'Saudi Arabia') - , ('SB', 'SLB', 'Solomon Islands') - , ('SC', 'SYC', 'Seychelles') - , ('SD', 'SDN', 'Sudan (the)') - , ('SE', 'SWE', 'Sweden') - , ('SG', 'SGP', 'Singapore') - , ('SH', 'SHN', 'Saint Helena, Ascension and Tristan da Cunha') - , ('SI', 'SVN', 'Slovenia') - , ('SJ', 'SJM', 'Svalbard and Jan Mayen') - , ('SK', 'SVK', 'Slovakia') - , ('SL', 'SLE', 'Sierra Leone') - , ('SM', 'SMR', 'San Marino') - , ('SN', 'SEN', 'Senegal') - , ('SO', 'SOM', 'Somalia') - , ('SR', 'SUR', 'Suriname') - , ('SS', 'SSD', 'South Sudan') - , ('ST', 'STP', 'Sao Tome and Principe') - , ('SV', 'SLV', 'El Salvador') - , ('SX', 'SXM', 'Sint Maarten (Dutch part)') - , ('SY', 'SYR', 'Syrian Arab Republic') - , ('SZ', 'SWZ', 'Swaziland') - , ('TC', 'TCA', 'Turks and Caicos Islands (the)') - , ('TD', 'TCD', 'Chad') - , ('TF', 'ATF', 'French Southern Territories (the)') - , ('TG', 'TGO', 'Togo') - , ('TH', 'THA', 'Thailand') - , ('TJ', 'TJK', 'Tajikistan') - , ('TK', 'TKL', 'Tokelau') - , ('TL', 'TLS', 'Timor-Leste') - , ('TM', 'TKM', 'Turkmenistan') - , ('TN', 'TUN', 'Tunisia') - , ('TO', 'TON', 'Tonga') - , ('TR', 'TUR', 'Turkey') - , ('TT', 'TTO', 'Trinidad and Tobago') - , ('TV', 'TUV', 'Tuvalu') - , ('TW', 'TWN', 'Taiwan (Province of China)') - , ('TZ', 'TZA', 'Tanzania, United Republic of') - , ('UA', 'UKR', 'Ukraine') - , ('UG', 'UGA', 'Uganda') - , ('UM', 'UMI', 'United States Minor Outlying Islands (the)') - , ('US', 'USA', 'United States of America (the)') - , ('UY', 'URY', 'Uruguay') - , ('UZ', 'UZB', 'Uzbekistan') - , ('VA', 'VAT', 'Holy See (the)') - , ('VC', 'VCT', 'Saint Vincent and the Grenadines') - , ('VE', 'VEN', 'Venezuela (Bolivarian Republic of)') - , ('VG', 'VGB', 'Virgin Islands (British)') - , ('VI', 'VIR', 'Virgin Islands (U.S.)') - , ('VN', 'VNM', 'Viet Nam') - , ('VU', 'VUT', 'Vanuatu') - , ('WF', 'WLF', 'Wallis and Futuna') - , ('WS', 'WSM', 'Samoa') - , ('YE', 'YEM', 'Yemen') - , ('YT', 'MYT', 'Mayotte') - , ('ZA', 'ZAF', 'South Africa') - , ('ZM', 'ZMB', 'Zambia') - , ('ZW', 'ZWE', 'Zimbabwe') +INSERT INTO countries (code) + VALUES ('AD') , ('AE') , ('AF') , ('AG') , ('AI') , ('AL') , ('AM') , ('AO') , ('AQ') , ('AR') + , ('AS') , ('AT') , ('AU') , ('AW') , ('AX') , ('AZ') , ('BA') , ('BB') , ('BD') , ('BE') + , ('BF') , ('BG') , ('BH') , ('BI') , ('BJ') , ('BL') , ('BM') , ('BN') , ('BO') , ('BQ') + , ('BR') , ('BS') , ('BT') , ('BV') , ('BW') , ('BY') , ('BZ') , ('CA') , ('CC') , ('CD') + , ('CF') , ('CG') , ('CH') , ('CI') , ('CK') , ('CL') , ('CM') , ('CN') , ('CO') , ('CR') + , ('CU') , ('CV') , ('CW') , ('CX') , ('CY') , ('CZ') , ('DE') , ('DJ') , ('DK') , ('DM') + , ('DO') , ('DZ') , ('EC') , ('EE') , ('EG') , ('EH') , ('ER') , ('ES') , ('ET') , ('FI') + , ('FJ') , ('FK') , ('FM') , ('FO') , ('FR') , ('GA') , ('GB') , ('GD') , ('GE') , ('GF') + , ('GG') , ('GH') , ('GI') , ('GL') , ('GM') , ('GN') , ('GP') , ('GQ') , ('GR') , ('GS') + , ('GT') , ('GU') , ('GW') , ('GY') , ('HK') , ('HM') , ('HN') , ('HR') , ('HT') , ('HU') + , ('ID') , ('IE') , ('IL') , ('IM') , ('IN') , ('IO') , ('IQ') , ('IR') , ('IS') , ('IT') + , ('JE') , ('JM') , ('JO') , ('JP') , ('KE') , ('KG') , ('KH') , ('KI') , ('KM') , ('KN') + , ('KP') , ('KR') , ('KW') , ('KY') , ('KZ') , ('LA') , ('LB') , ('LC') , ('LI') , ('LK') + , ('LR') , ('LS') , ('LT') , ('LU') , ('LV') , ('LY') , ('MA') , ('MC') , ('MD') , ('ME') + , ('MF') , ('MG') , ('MH') , ('MK') , ('ML') , ('MM') , ('MN') , ('MO') , ('MP') , ('MQ') + , ('MR') , ('MS') , ('MT') , ('MU') , ('MV') , ('MW') , ('MX') , ('MY') , ('MZ') , ('NA') + , ('NC') , ('NE') , ('NF') , ('NG') , ('NI') , ('NL') , ('NO') , ('NP') , ('NR') , ('NU') + , ('NZ') , ('OM') , ('PA') , ('PE') , ('PF') , ('PG') , ('PH') , ('PK') , ('PL') , ('PM') + , ('PN') , ('PR') , ('PS') , ('PT') , ('PW') , ('PY') , ('QA') , ('RE') , ('RO') , ('RS') + , ('RU') , ('RW') , ('SA') , ('SB') , ('SC') , ('SD') , ('SE') , ('SG') , ('SH') , ('SI') + , ('SJ') , ('SK') , ('SL') , ('SM') , ('SN') , ('SO') , ('SR') , ('SS') , ('ST') , ('SV') + , ('SX') , ('SY') , ('SZ') , ('TC') , ('TD') , ('TF') , ('TG') , ('TH') , ('TJ') , ('TK') + , ('TL') , ('TM') , ('TN') , ('TO') , ('TR') , ('TT') , ('TV') , ('TW') , ('TZ') , ('UA') + , ('UG') , ('UM') , ('US') , ('UY') , ('UZ') , ('VA') , ('VC') , ('VE') , ('VG') , ('VI') + , ('VN') , ('VU') , ('WF') , ('WS') , ('YE') , ('YT') , ('ZA') , ('ZM') , ('ZW') ;