表中出现多个timestamp并设置为current_timestamp的时候报错
原因是当你给一个timestamp设置为on updatecurrent_timestamp的时候,其他的timestamp字段需要显式设定default值
原来:
CreateTime
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间’,
UpdateTime
timestamp not null default CURRENT_TIMESTAMP COMMENT ‘更新时间’,
修改:
CreateTime
datetime NOT NULL COMMENT ‘创建时间’,
UpdateTime
timestamp not null default CURRENT_TIMESTAMP COMMENT ‘更新时间’,