Quiero definir la tabla que tendrá 2 campos de fecha y hora, calle detrás de esta manera:MySQL CURRENT_TIMESTAMP en crear y en la actualización
CREATE TABLE `msgs` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`msg` VARCHAR(256),
`ts_create` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`ts_update` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
Cómo hacer este error evitando:
ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
punto es mantenga el comportamiento deseado de ts_create
y ts_update
en el esquema de la tabla.
Creo que el error es claro y lo que buscas es la forma alternativa de usar haz lo mismo que current_timestamp – GusDeCooL