Reputation: 59079
Will the CURRENT_TIMESTAMP column be updated even if I UPDATE some other column in the row?
Upvotes: 0
Views: 158
Reputation: 95173
Yes, if you set the auto-update value to be CURRENT_TIMESTAMP
, it will always update, regardless of which columns you updated. You don't have to specify the field and set it to CURRENT_TIMESTAMP
, as it will do it on its own.
Be advised that you cannot have one column with a default value of CURRENT_TIMESTAMP
and another column with the auto-update value of CURRENT_TIMESTAMP
.
See more in the MySQL docs here.
Upvotes: 3