I am having problem while altering a table. I need a column with data type DATETIME to take default value as current date/time and on update also it should automatically update it's value to current date/time. I am writing the following SQL
ALTER TABLE `groups`
CHANGE COLUMN `modified` `modified` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
I am getting the following error message.
Error Code: 1067. Invalid default value for 'modified'
The MySQL version I'm using is 5.5.49 on a Ubuntu 14.04.1 system.
Please let me know how this can be fixed.