Adding in Second and Minute time grains for MySQL (#696)

* 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 0b6dd696d6.

* Code Cleanliness
This commit is contained in:
alanmcruickshank 2016-07-13 16:20:40 +01:00 committed by Maxime Beauchemin
parent 09c95fb28a
commit 65efe53bfc

View File

@ -414,6 +414,11 @@ class Database(Model, AuditMixinNullable):
),
'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})'),