forked from anudeep-danne/local-material-mate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_user_data.sql
More file actions
32 lines (29 loc) · 754 Bytes
/
check_user_data.sql
File metadata and controls
32 lines (29 loc) · 754 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
26
27
28
29
30
31
32
-- Check current user data to see what's in the database
-- Run this in your Supabase SQL Editor
-- Check all users and their business information
SELECT
id,
name,
email,
role,
business_name,
phone,
city,
state,
created_at
FROM public.users
WHERE role = 'supplier' OR role = 'vendor'
ORDER BY created_at DESC;
-- Check if there are any products and their supplier information
SELECT
p.id as product_id,
p.name as product_name,
p.supplier_id,
u.name as supplier_name,
u.business_name as supplier_business_name,
u.email as supplier_email
FROM public.products p
JOIN public.users u ON p.supplier_id = u.id
ORDER BY p.created_at DESC;
-- Check the users_with_incomplete_data view
SELECT * FROM users_with_incomplete_data;