I had a problem trying to run my database script on the server. The error already gives in the first table that the script generates:
CREATE TABLE IF NOT EXISTS 'categoria' (
'cd_categoria' int(255) NOT NULL,
'titulo' varchar(100) NOT NULL,
'cd_status' int(1) NOT NULL,
'dh_timestamp' datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
'dh_alteracao' datetime NOT NULL
) ;
The error that happens is as follows:
Error Code: 1067. Invalid default value for 'dh_timestamp'
I did not understand what happened because I need my script to store in the dh_timestamp column the current date on which there is a record of something. How can I fix this?