albertlyu / shot-charts-site

A Rails web application for visualizing NCAA men's basketball play-by-play shot location data
MIT License
3 stars 1 forks source link

Long shots attempted metric calculated incorrectly #52

Closed albertlyu closed 10 years ago

albertlyu commented 10 years ago

Found a data bug. Working on fixing the migration script right now.

Long shots attempted should be SUM(CASE WHEN shots.distance > 0 AND shots.distance <= 8 THEN 1 ELSE 0 END) AS long_att, not SUM(CASE WHEN shots.distance > 14 AND shots.distance < 20.75 THEN 1 ELSE 0 END) AS long_att.

albertlyu commented 10 years ago

Deploying this to the site now. I hope nobody updated their database between ~5am CST and ~10am CST today. But just in case you did, once you fetch upstream, you'll need to run the following commands in your development environment:

rake db:rollback step=2 rake db:migrate

What this does is it rolls back the shot stats migration scripts, particularly the ones in 22dae901c9611a6d7116c5e85cbf19ea8e4cf565. Then it migrates those scripts again with the changes. Most likely, all you'll need is to only run rake db:migrate though.