Skip to content

Commit

Permalink
Adding Minute and Second time grains for MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcruickshank committed Jun 29, 2016
1 parent 5d0c215 commit db06a7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ 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 db06a7c

Please sign in to comment.