Worldcubeassociation.org: Add a results_uploaded? field to the Competitions table

Created on 4 May 2016  路  7Comments  路  Source: thewca/worldcubeassociation.org

Copy pasting my email about why I believe this is a good idea:

I support having an explicit field in the database for if competition's results are posted.

In addition to the "have results been uploaded?" checkbox Pedro mentioned, it would be nice to add a little notification to https://github.com/cubing/worldcubeassociation.org/blob/master/WcaOnRails/app/helpers/notifications_helper.rb for delegates to remember to submit their results (although this should probably wait until we have some way of knowing if they've actually submitted their results yet, because it would be annoying to keep reminding a delegate that results from his competition still haven't been uploaded just because the Results team hasn't gotten around to uploading them yet).

Furthermore, checking if there just happen to be any Results with competitionId == the competition isn't really an accurate measurement of if Results have been uploaded yet, as a Results team member might still be in the middle of posting results for that competition.

@pedrosino, would you be interested in taking this on, and then updating the /competitions list to show something cool?

Most helpful comment

On further thought, let's make this new field a datetime, not a mere boolean. Then we can do cool stuff like checking how long it took to get results posted :)

All 7 comments

On further thought, let's make this new field a datetime, not a mere boolean. Then we can do cool stuff like checking how long it took to get results posted :)

I would be interested, yes.
I'll try to work on this today.

Are we using datetime or timestamp?

Datetime, I believe.

  • [x] Create new column results_uploaded/posted
  • [x] Fill column for current competitions (when?)
  • [x] Tweak results posting script to fill the new column automatically
  • [x] Add an icon to /competitions indicating that results are posted

Fill column for current competitions (when?)

I've recently added an updated_at timestamp to the Results table: https://github.com/cubing/worldcubeassociation.org/blob/master/WcaOnRails/db/migrate/20160407210623_add_updated_at_to_results.rb. You can probably use the maximum as a starting point. For old competitions this will be the same as the end date of the competition and for more recent ones this will reflect the upload date.

You used timestamp there, but Jeremy said Datetime here...
What's the difference and which one should I use?

You used timestamp there

That wasn't a well informed decision. It looks like the Rails' datetime in migrations gets translated to datetime in MySQL. So, just use this?

Was this page helpful?
0 / 5 - 0 ratings