Rinvex Country is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.
For the past year or two, I've been using a custom countries database table, so that my users can be associated with a country_id. However, I'm becoming more and more fond of this library, and am finding that more and more I'm using this instead of my own table for things other than long-term database storage.
Now; my question has to do with the long-term usage of this library. If I were to slowly migrate away from having a countries table and using this library instead (via a custom wrapper), what would be the most reasonable 'key' to identify a country? Should users have a country_code that contains the ISO 3166 Alpha-2 instead? Or the ISO 3166 Numeric? Or something else? What would be the most reasonable long-term 'key' here?
For the past year or two, I've been using a custom
countries
database table, so that my users can be associated with acountry_id
. However, I'm becoming more and more fond of this library, and am finding that more and more I'm using this instead of my own table for things other than long-term database storage.Now; my question has to do with the long-term usage of this library. If I were to slowly migrate away from having a
countries
table and using this library instead (via a custom wrapper), what would be the most reasonable 'key' to identify a country? Should users have acountry_code
that contains the ISO 3166 Alpha-2 instead? Or the ISO 3166 Numeric? Or something else? What would be the most reasonable long-term 'key' here?