【发布时间】:2015-04-15 17:33:07
【问题描述】:
我有这张桌子:
CREATE TABLE IF NOT EXISTS news (
id int(11) NOT NULL AUTO_INCREMENT,
data text,
date_published timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
date_edited timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
给我这个错误:
#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause.
有关于这个问题的旧帖子,但由于当前的数据库结构,我想要一个适当的解决方法。
版本:libmysql - 5.5.41 运行于:5.5.41-ubuntu.14.04.1
【问题讨论】:
-
“由于当前的数据库结构,我想要一个适当的解决方法”你是什么意思?你没有提到 mysql 版本,或者其他答案是什么,这使得它们不合适
-
现在添加 db 版本
标签: mysql timestamp mysql-error-1293