To Auto Timestamp A Row

Set row type as "timestamp"

Default: CURRENT_TIMESTAMP

On Update Current_Timestamp: checked if you want the timestamp to update when the row changed, not checked to only timewstamp it on creation.

This is an equivalent in code:


CREATED timestamp NOT NULL default '0000-00-00 00:00:00',
UPDATED timestamp NOT NULL default now() on update now(),

Note:  mySQL limitation is that you cannot have two TIMESTAMP columns with defaults that reference CURRENT_TIMESTAMP. 

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *