Why won't MySQL let me remove attribute "on update CURRENT_TIMESTAMP"? Why won't MySQL let me remove attribute "on update CURRENT_TIMESTAMP"? mysql mysql

Why won't MySQL let me remove attribute "on update CURRENT_TIMESTAMP"?


You should specify DEFAULT CURRENT_TIMESTAMP (or DEFAULT 0)

ALTER TABLE pages CHANGE date_created date_created TIMESTAMP NOT NULL DEFAULT 0,CHANGE  `date_updated`  `date_updated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL


As of MySQL version 5.6.6, you can use the explicit_defaults_for_timestamp option in the configuration file, therefore timestamp columns will not have 'DEFAULT CURRENT_TIMESTAMP' or 'ON UPDATE CURRENT_TIMESTAMP' attributes by default. It will also be possible so set these columns to NULL if they are not declared as NOT NULL.

See: http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp