This commit is contained in:
2026-02-04 17:35:46 +08:00
parent 7344aaae77
commit 0ee4577b31
82 changed files with 20458 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
-- ============================================
-- 用户登录 / 注册 测试数据
-- 位置pages/user/test/USER_AUTH_TEST_DATA.sql
-- 用途:
-- - 准备少量业务侧测试数据,方便前端联调登录/个人中心
-- - 注意Supabase 的 auth.users 建议通过实际“注册”流程生成,这里不直接插入
-- ============================================
-- 1. 如果你已经通过注册页创建了账号auth.users 中有记录),
-- 可以在 ak_users 中补充一条测试资料:
-- 把 '00000000-0000-0000-0000-000000000001' 替换成自己 auth.users 里的 id。
insert into public.ak_users (id, username, email, role)
values
('00000000-0000-0000-0000-000000000001', 'demo_user', 'demo@example.com', 'analyst')
on conflict (id) do update
set
username = excluded.username,
email = excluded.email,
role = excluded.role;
-- 2. 可选:补充 users / user_sessions 基础数据,方便分析模块统计演示
insert into public.users (id, email, nickname)
values
('00000000-0000-0000-0000-000000000001', 'demo@example.com', 'Demo 分析师')
on conflict (id) do update
set
email = excluded.email,
nickname = excluded.nickname;
insert into public.user_sessions (user_id, session_token, is_active)
values
('00000000-0000-0000-0000-000000000001', 'demo-session-token', true);