sell 项目 订单详情表 设计 及 创建

时间:2023-03-09 14:29:08
sell 项目  订单详情表 设计 及 创建

1.数据库设计

sell 项目  订单详情表 设计 及 创建

2.订单详情表 创建

/**
* 订单详情表
*/
create table `order_detail` (
`detail_id` varchar(32) not null,
`order_id` varchar(32) not null,
`product_id` varchar(32) not null,
`product_name` varchar(64) not null comment '商品名称',
`product_price` decimal(8,2) not null comment '商品价格',
`product_quantity` int not null comment '商品数量',
`product_icon` varchar(512) comment '商品小图',
`create_time` timestamp not null default current_timestamp comment '创建时间',
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
primary key (`detail_id`),
key `idx_order_id` (`order_id`)
) comment '订单详情表';

.