Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderitem表结构需要重新更新下 #34

Open
liankui opened this issue Jul 23, 2022 · 0 comments
Open

orderitem表结构需要重新更新下 #34

liankui opened this issue Jul 23, 2022 · 0 comments

Comments

@liankui
Copy link

liankui commented Jul 23, 2022

CREATE TABLE `orderitem` (

1.字段按照其他表统一为没有下划线格式
2.id增加AUTO_INCREMENT属性

CREATE TABLE orderitem
(
id bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单子表id',
orderid varchar(64) NOT NULL DEFAULT '' COMMENT '订单id',
userid bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户id',
proid bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品id',
proname varchar(100) NOT NULL DEFAULT '' COMMENT '商品名称',
proimage varchar(500) NOT NULL DEFAULT '' COMMENT '商品图片地址',
currentunitprice decimal(20, 2) NOT NULL DEFAULT 0 COMMENT '生成订单时的商品单价,单位是元,保留两位小数',
quantity int(10) NOT NULL DEFAULT 0 COMMENT '商品数量',
totalprice decimal(20, 2) NOT NULL DEFAULT 0 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 (id),
KEY ix_orderid (orderid),
KEY ix_userid (userid),
KEY ix_proid (proid)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='订单明细表';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant