Comments (7)
Based on our conversation below is a model of the current breweries
table along with the proposed changes. This model currently implements a "Type 2" format where the current record has no end_at
date.
Model: https://dbdiagram.io/d/61d360353205b45b73d55971
Considerations
- For
start_at
andend_at
do we really care about the time or is the date good enough?
Todo
- Column settings like restrictions on length, nullable and any FKs should be documented
- There should probably be constraint aka 2 part key for the
field tbd
andend_at
to prevent duplicates - Type 2 has no record identifier right now tying the history of a model
Changelog
Added
start_at
andend_at
to make the table a type 2 for history
Changed
obdb_id
uses uuid v4 instead of a slug from the namebrewery_type
totype
, context is already set as the brewery no need to duplicate itstreet
changed toaddress_line_1
for consistencyaddress_2
andaddress_3
renamed toaddress_line_x
country_province
combines thestate
andcountry_province
columns to support foreign addressescountry
limited to 2 characters to support only the ISO code format https://www.countrycode.org/postal_code
shortened topostcode
from openbrewerydb.
@alexjustesen This is more of what I'm thinking about with the schema (I also updated the v1 to be more based on reality): https://dbdiagram.io/d/61d3c9533205b45b73d5a738
Table breweries_v1 {
id integer [pk]
obdb_id varchar
name varchar
brewery_type varchar
street varchar
address_2 varchar
address_3 varchar
city varchar
state varchar
postal_code varchar
county_province varchar
country varchar
longitude decimal
latitude decimal
website_url varchar
phone varchar
tags text
created_at datetime
updated_at datetime
}
Table breweries_v2 as proposed {
id uuid [pk]
name varchar
brewery_type varchar
address_line_1 varchar
address_line_2 varchar
address_line_3 varchar
city varchar
state_province varchar
postcode varchar
country varchar
longitude decimal
latitude decimal
website_url varchar
phone varchar
created_at datetime
updated_at datetime
start_at date
end_at date
}
We still have the "key problem" you mention in your third TODO. I guess just another UUID? Would be nice to have it be shorter. Maybe something based on lat/lng or would that be dumb?
from openbrewerydb.
Oh, and after thinking about it, the whole "slug" thing should be handled programmatically or in a mapping table. Seems a little silly to hard-code it here.
from openbrewerydb.
Oh, and after thinking about it, the whole "slug" thing should be handled programmatically or in a mapping table. Seems a little silly to hard-code it here.
I agree, the slug for SEO purposes should be generated off the name where it's being used.
from openbrewerydb.
I removed slug
from my model and changed brewery_type
to just type
as the context is already the brewery so no need to duplicate the name.
from openbrewerydb.
@alexjustesen Sounds good!
I think the whole brewery_type
name came about because I ran into issues with type
being reserved or something. Probably something automagic in Rails I wasn't using right.
from openbrewerydb.
@alexjustesen Sounds good!
I think the whole
brewery_type
name came about because I ran into issues withtype
being reserved or something. Probably something automagic in Rails I wasn't using right.
I think you're right, I'll switch it back
from openbrewerydb.
Related Issues (20)
- Question: How to handle closed breweries? HOT 4
- Some Bad Characters in Data: © -> � or © -> â HOT 3
- International translations
- Add Cloudflare Cache Cleaner Github Action HOT 1
- Github Action > Update Open Brewery DB API HOT 6
- OpenStreetMap database ? HOT 1
- Broken search by keyword and autocomplete queries HOT 2
- Autocomplete endpoint does not match documentation HOT 3
- 🇬🇧 UK Schema HOT 6
- Add Contributors HOT 10
- Add gzipped versions of datasets HOT 1
- ArcGIS REST Service HOT 15
- Replace `frictionless` with `csv-file-validator`
- Add US Census data
- Add Breweries with missing/not enough data HOT 7
- CLI tool to create obdb_id
- Discussion: Scraping for brewery data
- Fix how international phone numbers are handled HOT 7
- Add Brewery Data Change Manager
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openbrewerydb.