i have column say ts_activity with datatype timestamp in MYSQL and default value to current timestamp. I want to add on update apply current time stamp to this column value. >
Try this query -
ALTER TABLE table_name CHANGE COLUMN column_name column_name TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
Note, in the table only one field can be with 'ON UPDATE CURRENT_TIMESTAMP' option.