I was creating a table in the database and the following error appeared:
Invalid default value for "updated_at"
Here's the table to create:
CREATE TABLE 'user' (
'id' INT( 11 ) NOT NULL ,
'uuid' CHAR( 12 ) NOT NULL ,
'fullname' VARCHAR( 512 ) DEFAULT NULL ,
'username' VARCHAR( 128 ) DEFAULT NULL ,
'email' VARCHAR( 512 ) DEFAULT NULL ,
'device' TEXT,
'created_at' TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ,
'updated_at' DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE = MYISAM DEFAULT CHARSET = latin1;
The database is created on a machine with Amazon Linux AMI , and I am using MySQL client version 5.5.54 . Is it something related to the version? How can I solve the problem?