In MySQL, when the record is updated, the timestamp type is automatically updated At bitsCN.com.
Timestamp-type automatic update time when the record is updated in MySQL
When I use navicat to set the date type to timestamp, I will find that IDE has one more option:
View the SQL statements automatically generated by IDE:
Write
'Lastupdate' timestamp not null default '2017-00-00 00:00:00 'on update CURRENT_TIMESTAMP
If this option is removed:
Write
'Lastupdate' timestamp not null default '2017-00-00 00:00:00'
The difference is "on update CURRENT_TIMESTAMP". its function is to automatically UPDATE the lastUpdate time to the current system time when there is a "change" in the record.
Note: The change is emphasized. In other words, this value will not be automatically updated even if the update statement is used but the content does not change.
BitsCN.com