Drupal - How to implement a mysql date or datetime field correctly in hook_schema()?
You should provide a fallback type (varchar
) for the case that the database is not mysql.
'pubblish_date' => array(
'description' => t('The pubblish date for the single news'),
'type' => 'varchar',
'mysql_type' => 'datetime',
'not null' => FALSE,
),
'unpublish_date' => array(
'description' => t('The unpublish date for the single news'),
'type' => 'varchar',
'mysql_type' => 'datetime',
'not null' => FALSE,
),
However, the messages you see come from the Schema module. This problem is already recorded as issue #468644.
The implementation of the mysql datetime in your schema is fine. You can safely ignore these messages. I would say that these "advice messages" are caused by a bug in the Schema module.