电商系统客户订单存储与管理
1. 客户账户添加订单
为了让客户能够通过账户下单,需要对数据库、业务层和表示层进行一系列修改。
1.1 数据库修改
- 订单表修改 :新的订单表与之前的数据不完全兼容,需要删除现有数据并进行备份。具体修改如下:
- 清除所有现有数据。
- 删除
customer_name、shipping_address和customer_email字段。 - 添加
customer_id、auth_code和reference字段,其中customer_id引用客户表,指定下单的客户。
-- Delete all records from order_detail table
DELETE FROM order_detail;
-- Delete all records from orders table
DELETE FROM orders;
-- Drop customer_name field from orders table
ALTER TABLE orders DROP COLUMN customer_name;
-- Drop shipping_address field fro
超级会员免费看
订阅专栏 解锁全文
8万+

被折叠的 条评论
为什么被折叠?



