Update Database design authored by Josh Sun's avatar Josh Sun
CREATE SCHEMA `FreshOnline` ;
`stocked_goods`: (id:int, name:varchar, type: tinyint, price: decimal2, storage: decimal2, sales: decimal2, description: text(NULL), onsale: tinyint, sale_price: decimal2(NULL), rate: float(NULL), rate_count: int(DEFAULT 0), brand: varchar, category_id: int, isnew: tinyint, pic: varchar500(多值属性 NULL)) type==0:discrete,type==1:weight
`stocked_goods`: (id:int, name:varchar, type: tinyint, price: decimal2, storage: decimal2, sales: decimal2, description: text(NULL), onsale: tinyint, sale_price: decimal2(NULL), rate: float(NULL), rate_count: int(DEFAULT 0), brand: varchar, category_id: int, isnew: tinyint, pic: varchar500(multi-attribute NULL)) type==0:discrete,type==1:weight
`category`: (id:int, name: varchar, parent_id:int, level:int)
//level分三级1 2 3, 默认1级level的parent_id是0
//level: 1 2 3, categories which have level with one have a parent_id 0.
`saled_goods`: (order_id, goods_id, price:decimal2, count:decimal2, comment: text(NULL), rate: int(NULL))
`orders`: (order_id, user_id, payment_method_id(NULL), order_time:datetime, pay_time:datetime(NULL), finish_time:datetime(NULL), status: tinyint, location: varchar500)
// statues 已付款 已送达 订单已完成
// statues paid, delivered, order finished
`user`: (id, password:varchar(hashed), name: varchar, token: varchar, email:varchar(hashed), type:tinyint, location: varchar500(多值属性, NULL))
`user`: (id, password:varchar(hashed), name: varchar, token: varchar, email:varchar(hashed), type:tinyint, location: varchar500(multi-attribute, NULL))
`payment_method`: (id, user_id, payment_type:tinyint, details: json(encrypted, salt=password))
......
......