testというDBにorg_categoryというテーブルを追加したい
MySQLを起動して以下のコードでテーブルを作成しようとした
CREATE TABLE test.org_category (
category_id INT(2) NOT NULL PRIMARY KEY COMMENT 'カテゴリID',
name VARCHAR(200) NOT NULL COMMENT '名前',
url VARCHAR(200) NOT NULL COMMENT 'URL',
create_date timestamp not null default current_timestamp COMMENT '作成日',
`update-date` timestamp not null default current_timestamp COMMENT '更新日'
);
しかし、
ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
というエラーが出てしまい失敗。
原因を調べてみたところ以下のような記事を発見した
https://runble1.com/mysql-current-timestamp/
timestampがどうやら原因のようだが、対処法が分からなかったので質問させて頂きました。
よければ教えていただけると光栄です。