timestamp type column default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
mysql>
mysql> CREATE TABLE categories (
-> id int(11) NOT NULL auto_increment,
-> ts timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-> PRIMARY KEY (id)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql>
mysql> drop table categories;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category