---restore content starts---
2018-07-26
CREATE TABLE Product_info (
product_id VARCHAR (+) not NULL,
product_name VARCHAR (+) not NULL COMMENT ' commodity name ',
Product_price DECIMAL (8, 2) not NULL COMMENT ' unit price ',
product_stock INT not NULL COMMENT ' inventory ',
product_description VARCHAR (COMMENT ' description '),
Product_icon VARCHAR (COMMENT) ' Little picture ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (product_id)
) COMMENT = ' commodity table ';
CREATE TABLE product_category (
category_id INT not NULL auto_increment,
category_name VARCHAR (+) not NULL COMMENT ' commodity name ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (category_id),
UNIQUE KEY uqe_category_type (category_type)
) COMMENT = ' class table ';
CREATE TABLE Order_master (
order_id VARCHAR (+) not NULL,
buyer_name VARCHAR (+) not NULL COMMENT ' buyer name ',
Buyer_phone VARCHAR (+) COMMENT ' buyer's phone ',
buyer_address VARCHAR (+) COMMENT ' buyer address ',
Buyer_openid VARCHAR (+) COMMENT ' buyer address ',
Order_amount DECIMAL (8, 2) not NULL COMMENT ' order total amount ',
pay_status TINYINT (3) not NULL default 0 COMMENT ' order status, default 0 new orders ',
order_status TINYINT (3) not NULL default 0 COMMENT ' order status, default 0 not paid ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (order_id),
KEY Idx_buyer_openid (Buyer_openid)
) COMMENT = ' order form ';
CREATE TABLE Order_detai (
detail_id VARCHAR (+) not NULL,
order_id VARCHAR (+),
product_name VARCHAR (+) not NULL COMMENT ' commodity name ',
Product_price DECIMAL (8, 2) not NULL COMMENT ' commodity price ',
product_quantity INT not NULL COMMENT ' quantity of goods ',
Product_icon VARCHAR (COMMENT) ' commodity little picture ',
category_type INT not NULL COMMENT ' class number ',
create_time TIMESTAMP not NULL DEFAULT current_timestamp COMMENT ' creation time ',
update_time TIMESTAMP not NULL the DEFAULT current_timestamp on update current_timestamp COMMENT ' modified time ',
PRIMARY KEY (detail_id),
KEY idx_order_id (order_id)
) COMMENT = ' Order Details table ';
---restore content ends---
Enterprise Ordering System Database script