image.png

    1. CREATE TABLE `t_delivery`(
    2. `id` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '主键',
    3. `order_id` INT UNSIGNED NOT NULL COMMENT '订单ID',
    4. `sku` JSON NOT NULL COMMENT '商品',
    5. `qa_id` INT UNSIGNED NOT NULL COMMENT '质检员ID',
    6. `dy_id` INT UNSIGNED NOT NULL COMMENT '发货员ID',
    7. `post_id` INT UNSIGNED NOT NULL COMMENT '快递单号',
    8. `price` DECIMAL(4, 2) UNSIGNED NOT NULL COMMENT '快递费',
    9. `d_company` TINYINT UNSIGNED NOT NULL COMMENT '快递公司编号',
    10. `address_id` INT UNSIGNED NOT NULL COMMENT '收货地址ID',
    11. `warehouse_id` INT UNSIGNED NOT NULL COMMENT '仓库ID',
    12. `created_at` TIMESTAMP NOT NULL DEFAULT NOW() COMMENT '创建时间',
    13. INDEX idx_order_id(`order_id`),
    14. INDEX idx_qa_id(`qa_id`),
    15. INDEX idx_dy_id(`dy_id`),
    16. INDEX idx_post_id(`post_id`),
    17. INDEX idx_warehouse_id(`warehouse_id`),
    18. INDEX idx_address_id(`address_id`),
    19. INDEX idx_d_company(`d_company`)
    20. ) COMMENT = '快递表';