CREATE TABLE `t_rating`(
`id` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '主键',
`order_id` INT UNSIGNED NOT NULL COMMENT '订单ID',
`sku_id` INT UNSIGNED NOT NULL COMMENT '商品ID',
`img` JSON COMMENT '买家晒图',
`rating` TINYINT UNSIGNED NOT NULL COMMENT '评分',
`comment` VARCHAR(200) COMMENT '评论内容',
`created_at` TIMESTAMP NOT NULL DEFAULT NOW() COMMENT '创建时间',
INDEX idx_order_id(`order_id`),
INDEX idx_sku_id(`sku_id`),
INDEX idx_created_at(`created_at`)
) COMMENT = '评价表';