-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSETUP_ADMIN.sql
More file actions
25 lines (22 loc) · 794 Bytes
/
SETUP_ADMIN.sql
File metadata and controls
25 lines (22 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- ==================================================
-- ADMIN SETUP SCRIPT
-- ==================================================
-- Run this in Supabase SQL Editor after signing up
-- Replace 'your-email@example.com' with your actual email
-- ==================================================
INSERT INTO public.user_roles (user_id, role)
SELECT id, 'admin'::public.app_role
FROM auth.users
WHERE email = 'your-email@example.com'
ON CONFLICT DO NOTHING;
-- ==================================================
-- VERIFY ADMIN ROLE
-- ==================================================
-- Run this to check if admin role was assigned:
SELECT
u.email,
ur.role,
ur.created_at
FROM auth.users u
LEFT JOIN public.user_roles ur ON u.id = ur.user_id
WHERE u.email = 'your-email@example.com';