基于Vue2商城管理系统数据表设计思路
- 用户表(User)
- 用户ID(ID):主键,自增
- 用户名(Username):唯一,不为空
- 密码(Password):不为空
- 手机号(Phone):唯一,不为空
- 邮箱(Email):唯一,不为空
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为空
- 商品表(Product)
- 商品ID(ID):主键,自增
- 商品名称(Name):不为空
- 商品描述(Description):不为空
- 商品价格(Price):不为空
- 商品图片(Image):不为空
- 商品分类ID(CategoryID):外键,不为空,关联商品分类表
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为空
- 商品分类表(Category)
- 分类ID(ID):主键,自增
- 分类名称(Name):不为空
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为空
- 订单表(Order)
- 订单ID(ID):主键,自增
- 用户ID(UserID):外键,不为空,关联用户表
- 订单状态(Status):不为空,包括待支付、已支付、已发货、已完成等
- 订单总金额(TotalAmount):不为空
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为空
- 订单详情表(OrderDetail)
- 订单详情ID(ID):主键,自增
- 订单ID(OrderID):外键,不为空,关联订单表
- 商品ID(ProductID):外键,不为空,关联商品表
- 商品数量(Quantity):不为空
- 商品单价(UnitPrice):不为空
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为空
- 购物车表(Cart)
- 购物车ID(ID):主键,自增
- 用户ID(UserID):外键,不为空,关联用户表
- 商品ID(ProductID):外键,不为空,关联商品表
- 商品数量(Quantity):不为空
- 创建时间(CreateTime):不为空
- 更新时间(UpdateTime):不为
原文地址: https://www.cveoy.top/t/topic/ioj6 著作权归作者所有。请勿转载和采集!