shop_platform - 資料庫實體關聯設計
資料庫:MySQL
Entities
User
[PK] id: INT
display_name: CHAR(50)
email: CHAR(50)
password: CHAR(140)
cell_phone: CHAR(20)
address: CHAR(100)
store_introduction: CHAR(2000)
role: CHAR(5)
insert_time: DATETIME
update_time: DATETIME
Category
[PK] id: INT
name: CHAR(50)
insert_time: DATETIME
update_time: DATETIME
Product
[PK] id: INT
name: CHAR(60)
price: INT
image_url: CHAR(100)
inventory: INT
description: TEXT(2000)
insert_time: DATETIME
update_time: DATETIME
[FK] seller_id
[FK] category_id
Cart
[PK] id: INT
insert_time: DATETIME
update_time: DATETIME
[FK] user id
CartItem
[PK][FK] cart_id
[PK][FK] product_id
quantity: INT
insert_time: DATETIME
update_time: DATETIME
ShippingStatus
[PK] id: INT
status: CHAR(60)
insert_time: DATETIME
update_time: DATETIME
PaymentStatus
[PK] id: INT
status: CHAR(60)
insert_time: DATETIME
update_time: DATETIME
OrderStatus
[PK] id: INT
status: CHAR(60)
insert_time: DATETIME
update_time: DATETIME
Order
[PK] id: INT
amount: INT
recipient: CHAR(50)
cell_phone: CHAR(20)
address: CHAR(100)
insert_time: DATETIME
update_time: DATETIME
[FK] seller_id
[FK] buyer_id
[FK] shipping_status_id
[FK] payment_status_id
[FK] order_status_id
Payment
[PK] id: INT
amount: INT
method: CHAR(50)
info: CHAR(100)
insert_time: DATETIME
update_time: DATETIME
[FK] order_id
OrderItem
[PK][FK] order id
[PK][FK] product id
price: INT
quantity: INT
insert_time: DATETIME
update_time: DATETIME
Rating
[PK] id: INT
score: BIT(3)
comment: TEXT(2000)
insert_time: DATETIME
update_time: DATETIME
[FK] rater_id
[FK] ratee_id
[FK] order_item_order_id
[FK] order_item_product_id
Question
[PK] id: INT
content: TEXT(2000)
insert_time: DATETIME
update_time: DATETIME
[FK] author_id
[FK] product_id
Reply
[PK] id: INT
content: TEXT(2000)
insert_time: DATETIME
update_time: DATETIME
[FK] author_id
[FK] question_id
Relation
GitHub: shop_platform/models/
最後更新日期:2021 年 9 月 26 日
Comments
Post a Comment