image.png

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