chore: 更新数据库脚本适配新增模块

- 更新 schema.sql 添加用户地址、收藏、评价、订单项表结构
- 更新测试数据和演示用户脚本
This commit is contained in:
2026-03-10 23:21:01 +08:00
parent 6788fcd5ea
commit 9f1c5f837e
5 changed files with 156 additions and 44 deletions

View File

@@ -11,12 +11,12 @@ WHERE username IN ('demo1', 'demo2', 'admin');
-- 插入正确的演示用户
-- demo1/demo2 密码: 123456
-- admin 密码: admin123
INSERT INTO users (username, password, email, phone, status, created_at, updated_at)
VALUES ('demo1', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo1@example.com', '13800138001', 1,
INSERT INTO users (username, password, email, phone, role, status, created_at, updated_at)
VALUES ('demo1', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo1@example.com', '13800138001', 'USER', 1,
NOW(), NOW()),
('demo2', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo2@example.com', '13800138002', 1,
('demo2', '$2a$10$N.zmdr9k7uOkXUJEkKWZaOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'demo2@example.com', '13800138002', 'USER', 1,
NOW(), NOW()),
('admin', '$2a$10$DOwVJZHH.5PkZKJKJKJKJOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'admin@example.com', '13800138000', 1,
('admin', '$2a$10$DOwVJZHH.5PkZKJKJKJKJOh.3VQ8nl83hq8/Qhx6.5PkZKJKJKJKJ', 'admin@example.com', '13800138000', 'ADMIN', 1,
NOW(), NOW());
-- 验证插入结果