-
-
Notifications
You must be signed in to change notification settings - Fork 360
Spec country code as 2-letter, use i18n-friendly column names for state/zip #72
Conversation
…te/zip The idea here would be to store countries as ISO 3166-1 alpha-2 strings for consistency. Also, the US is the only country with a ZIP code to my knowledge; everyone else calls them postal codes or postcodes. "State" is a little more widely used, but "region" is more correct for more places.
@iansltx Thanks for making these changes :)
Btw, why we shouldn't store the full country name?
Actually there's a location hierarchy: country -> state -> city -> address. So
This is fine. |
@vkWeb I got to run and grab lunch, but I think you were pretty much saying the same thing on the adress. Have fields that align well with a standard, like below, since we know those are well vetted for differences around the globe. The PostalAddress also confirms @iansltx 2-alpha country suggestion and looks like if you add in latitude and longitude then that covers geocoding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes! I have some ideas to offer:
Have you considered changing country's type to char(3)
? I work with these kinds of tables (& queries) all the time. Having that extra character can make it easier to read/work with data manipulation — Boosts overall readability and doesn't hurt the DB.
From #75
|
@allella How do we get the latitude and longitude? |
@vkWeb the address needs to be geocoded in order to get the longitude/latitude. there are various geocoding services around but here is the Geocoding API guide courtesy of Google: https://developers.google.com/maps/documentation/geocoding/intro |
So, I'm wondering if we're getting "location" confused with "venue". Location would be city-level or similar, while venue would have an exact address/geocode. @timrodz I'm not following your comment re: making the field a character longer than it needs to be. I've been doing this SQL thing for awhile, including using two-letter country codes, and haven't come across what you're talking about. |
@iansltx you're probably right about that. I just wanted to make sure if we're doing a zip, street and such that it follows a well thoughout naming convention and field definition, like schema.org |
@cmenedes Thanks for that API doc link. The address will be entered by users so we'll need to follow this: https://developers.google.com/maps/documentation/geocoding/best-practices#user-input No latitude or longitudes need to be stored in this case. Please correct me if I am going in the wrong direction. :) |
@cmenedes Or maybe we can add a field to allow users to enter the Google Map URL of the location? |
Please let's not require google services for this. OpenStreetMap geocoder and maps should be able to be used. |
Fair point of view - The ISO 3 offers better visual association, but I suppose we can always convert these through our codebase. Thanks for your PR 😄 |
@iansltx |
@matthewdarwin |
@vkWeb |
#46 was merged so that's not blocking things now. Though, there's a conflict on this one, so someone will need to clear that up. My only vote on this would be to use schema.org's vocabulary and not city, state, zip. That would be locality and region, which are apparently more global-friendly. |
Heading out for a movie momentarily; can catch this up tomorrow, or we can retire this in favor of someone who's able to get the schema stuff set up in shorter order. |
I'm happy to merge this to master and then update the schema diagram. The discussions about geocoding is not relevant to this specific issue relating to normalising country names and using more internationally friendly column names. |
@all-contributors please add @iansltx for code |
I've put up a pull request to add @iansltx! 🎉 |
The idea here would be to store countries as ISO 3166-1 alpha-2 strings for consistency. Also, the US is the only country with a ZIP code to my knowledge; everyone else calls them postal codes or postcodes. "State" is a little more widely used, but "region" is more correct for more places.
If this looks good, I'll figure out how to replace the DDL screenshot with one that reflects these schema changes.