20260204
This commit is contained in:
35
mall/pages/user/test/USER_AUTH_TEST_DATA.sql
Normal file
35
mall/pages/user/test/USER_AUTH_TEST_DATA.sql
Normal 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);
|
||||
|
||||
Reference in New Issue
Block a user