MySQL 5.6.5 The following version does not support multiple timestamp and is set to default Current_timestamp
The alternative is to use the trigger
create TABLE ' example ' (' id "INTEGER UNSIGNED not NULL auto_increment, ' created ' TIMESTAMP not null DEFAULT current_timestamp , ' lastupdated ' DATETIME not NULL, PRIMARY KEY (' // create TRIGGER ' Insert_example_trigger ' before insert On ' example ' for each ROW SET NEW. ' lastupdated ' = now ()
create TRIGGER ' Update_example_trigger ' before update on ' example '
for each ROW SET NEW. ' LastUpdated ' = now () // DELIMITER;
Trigger is associated with a table, and if the table is deleted, trigger is not
Insert, UPDATE, delete three behaviors can only correspond to a maximum of one trigger
Reference documents:
Http://www.jb51.net/article/50878.htm
Https://www.cnblogs.com/lmule/archive/2010/09/28/1837303.html
Https://www.cnblogs.com/nicholas_f/archive/2009/09/22/1572050.html
MySQL multiple TIMESTAMP error: There can is only one TIMESTAMP column with Current_timestamp