I have a timestamp in a mysql table with attribute \"ON UPDATE CURRENT_TIMESTAMP\". Is there a way to manually disable updating the timestamp on a special occasion? (eg: upd
To make your table/timestamp auto-update:
ALTER TABLE myTable
CHANGE myTimestampColumn
myTimestampColumn TIMESTAMP NOT NULL
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP;
To make it not auto-update:
ALTER TABLE myTable
CHANGE myTimestampColumn
myTimestampColumn TIMESTAMP NOT NULL
DEFAULT CURRENT_TIMESTAMP;
NOTE: The "default current_timestamp" part just sets it to the current stamp at default time, since the field is not-null. You can remove both the not null and the default, if you like.