Skip to content

Commit

Permalink
Adding in Second and Minute time grains for MySQL (#696)
Browse files Browse the repository at this point in the history
* Added documentation of the health check endpoint

* Adding Minute and Second time grains for MySQL

* Fixed Migration script so that it doesn't break when new fields added to the models for Dashboards or Slices (using declarative base)

* Revert "Fixed Migration script so that it doesn't break when new fields added to the models for Dashboards or Slices (using declarative base)"

This reverts commit 0b6dd69.

* Code Cleanliness
  • Loading branch information
alanmcruickshank authored and mistercrunch committed Jul 13, 2016
1 parent 09c95fb commit 65efe53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ def grains(self):
),
'mysql': (
Grain('Time Column', _('Time Column'), '{col}'),
Grain("second", _('second'), "DATE_ADD(DATE({col}), "
"INTERVAL (HOUR({col})*60*60 + MINUTE({col})*60"
" + SECOND({col})) SECOND)"),
Grain("minute", _('minute'), "DATE_ADD(DATE({col}), "
"INTERVAL (HOUR({col})*60 + MINUTE({col})) MINUTE)"),
Grain("hour", _('hour'), "DATE_ADD(DATE({col}), "
"INTERVAL HOUR({col}) HOUR)"),
Grain('day', _('day'), 'DATE({col})'),
Expand Down

0 comments on commit 65efe53

Please sign in to comment.