MYSQL alter table current_time 默认错误
MYSQL alter table current_time default error
我试图通过插入一个新属性 date1 来更改 table,它将自动设置 table 中每个条目的日期。
当我插入查询时
ALTER TABLE `vessellist` ADD `date1` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP FIRST;
它说 date1 的默认值无效
The DEFAULT clause specifies a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column
我试图通过插入一个新属性 date1 来更改 table,它将自动设置 table 中每个条目的日期。
当我插入查询时
ALTER TABLE `vessellist` ADD `date1` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP FIRST;
它说 date1 的默认值无效
The DEFAULT clause specifies a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column