The MySQL management tool I use automatically creates tables with column of the time ‘timestamp’ with the property
“ON UPDATE CURRENT_TIMESTAMP”. This property means that when a record is updated this column is automatically updated
to the current time. This behavior can be unwanted. You can check whether a column has this property by issuing a ‘desc’ command:
DESC `tag`
Which in this example will result in:
Field Type Null Key Default Extra
id int(10) unsigned NO PRI NULL auto_increment
label varchar(25) NO NULL
key varchar(25) NO NULL
specificDate date YES NULL ON UPDATE CURRENT_TIMESTAMP
The solution to this problem is to redefine the column manually without specifying this special property. It is possible to specify
a different default value than ‘CURRENT_TIMESTAMP’.
ALTER TABLE `tag`
CHANGE `specificDate` `specificDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
Based on stackoverflow.