新增电子书报错Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘doc_count’ cannot be null
; Column ‘doc_count’ cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: Column ‘doc_count’ cannot be null] with root cause
doc-count,view_count,vote_count的默认值都不生效
创建数据表sql
create table `ebook` (
`id` bigint not null comment 'id',
`name` varchar(50) comment '名称',
`category1_id` bigint comment '分类1',
`category2_id` bigint comment '分类2',
`description` varchar(200) comment '描述',
`cover` varchar(200) comment '封面',
`doc_count` int not null default 0 comment '文档数',
`view_count` int not null default 0 comment '阅读数',
`vote_count` int not null default 0 comment '点赞数',
primary key (`id`)
) engine=innodb default charset=utf8mb4 comment='电子书';