-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seckill table 创建出现end_time非法默认值 #4
Comments
由于使用的是mysql5.7,通过修改sql_mode已解决 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
执行
CREATE TABLE seckill(
seckill_id
bigint NOT NULL AUTO_INCREMENT COMMENT '商品库存id',name
varchar(120) NOT NULL COMMENT '商品名称',number
int NOT NULL COMMENT '库存数量',start_time
timestamp NOT NULL COMMENT '秒杀开启时间',end_time
timestamp NOT NULL COMMENT '秒杀结束时间',create_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',PRIMARY KEY(seckill_id),
key idx_start_time(start_time),
key idx_end_time(end_time),
key idx_create_time(create_time)
)ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表';
出现 ERROR 1067 (42000): Invalid default value for 'end_time' 错误
很是疑惑
The text was updated successfully, but these errors were encountered: