开发者

How do I alter a timestamp to set by default to the current time?

开发者 https://www.devze.com 2023-02-20 20:41 出处:网络
The code below doesn\'t seem to work even though the collumn and table does exist, any ideas? ALTER开发者_C百科 TABLE `table` CHANGE \'collumn_1\' \'collumn_1\' TIMESTAMP DEFAULT \'CURRENT_TIMESTAMP\

The code below doesn't seem to work even though the collumn and table does exist, any ideas?

ALTER开发者_C百科 TABLE `table` CHANGE 'collumn_1' 'collumn_1' TIMESTAMP DEFAULT 'CURRENT_TIMESTAMP' NOT NULL

I'm just trying to make the collumn available so it can store the current date and time when any data is added to this table.


ALTER TABLE `table` MODIFY collumn_1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;
0

精彩评论

暂无评论...
验证码 换一张
取 消