Skip to content

DB foundation_order

wuda0112 edited this page Dec 27, 2020 · 2 revisions

order

column name definition
order_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
seller_user_id BIGINT UNSIGNED NOT NULL COMMENT '卖家用户ID'
seller_store_id BIGINT UNSIGNED NOT NULL COMMENT '订单所属的店铺的ID,卖家的用户ID'
buyer_user_ild BIGINT UNSIGNED NOT NULL COMMENT '买家用户ID'
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
create_user_id BIGINT UNSIGNED NOT NULL
last_modify_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
last_modify_user_id BIGINT UNSIGNED NOT NULL
is_deleted BIGINT UNSIGNED NOT NULL DEFAULT 0

order_item

column name definition
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
order_id BIGINT UNSIGNED NOT NULL COMMENT '订单ID'
item_id BIGINT UNSIGNED NOT NULL COMMENT '商品ID'
item_variation_id BIGINT UNSIGNED NOT NULL COMMENT '商品规格的ID'
quantity INT UNSIGNED NOT NULL COMMENT '数量,对于卖家是卖出数量,对于买家是购买数量'

order_item_snapshot

column name definition
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
order_id BIGINT UNSIGNED NOT NULL COMMENT '订单ID'
item_id BIGINT UNSIGNED NOT NULL COMMENT '商品ID'
item_variation_id BIGINT UNSIGNED NOT NULL COMMENT '商品规格的ID'
purchase_price INT UNSIGNED NOT NULL COMMENT 'item_price,item_varition_price表中同名的字段定义一致'
line_throuth_price INT UNSIGNED NOT NULL COMMENT 'item_price,item_varition_price表中同名的字段定义一致'
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
create_user_id BIGINT UNSIGNED NOT NULL
Clone this wiki locally