nnjeim / world

A Laravel package which provides a list of the countries, states, cities, currencies, timezones and languages.
MIT License
748 stars 105 forks source link

Redundant country_code in states tables #39

Closed ronlinet closed 1 year ago

ronlinet commented 1 year ago

It isn't necessary to denormalise the states table. The country_code attribute already exists as the country.iso2 column and can be easily extracted with following SQL query

select * from countries join states on countries.id = states.country_id where countries.iso2 <> "AF";

nnjeim commented 1 year ago

@ronlinet please fell free to fork and do your modification. regarding the large number of people downloading and using ghe package i would be more conservative on backward compatibility.