In the server, I have MySQL version:
5.1.61
It has a table called test with 10 columns and 10K rows. Now I have decided to add a new column
ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
New column ts is added. but the problem is for existing rows this new column(ts)'s value is 00:000:000 Not current time.
PS: When I add new rows or update any existing row then the ts is updated with current time stamp.
why is default current_timestamp/now() not working for existing rows?
Edited: I can run a simple update SQL to update existing rows to the current time. But I am new in the database and I am trying to know if it is possible to update existing rows with a default value.