|
| 1 | +-- ===================================================== |
| 2 | +-- DATABASE STATUS CHECK |
| 3 | +-- ===================================================== |
| 4 | +-- Copy and paste this entire query into your Supabase SQL Editor |
| 5 | +-- and share the results with me |
| 6 | + |
| 7 | +-- 1. Check if profiles table exists |
| 8 | +SELECT |
| 9 | + 'Table Check' as check_type, |
| 10 | + table_name, |
| 11 | + CASE |
| 12 | + WHEN table_name = 'profiles' THEN 'EXISTS' |
| 13 | + ELSE 'OTHER TABLE' |
| 14 | + END as status |
| 15 | +FROM information_schema.tables |
| 16 | +WHERE table_schema = 'public' |
| 17 | +AND table_name = 'profiles'; |
| 18 | + |
| 19 | +-- 2. Check if update_username function exists |
| 20 | +SELECT |
| 21 | + 'Function Check' as check_type, |
| 22 | + proname as function_name, |
| 23 | + CASE |
| 24 | + WHEN proname = 'update_username' THEN 'EXISTS' |
| 25 | + ELSE 'OTHER FUNCTION' |
| 26 | + END as status |
| 27 | +FROM pg_proc |
| 28 | +WHERE proname = 'update_username'; |
| 29 | + |
| 30 | +-- 3. Check if set_username function exists |
| 31 | +SELECT |
| 32 | + 'Function Check' as check_type, |
| 33 | + proname as function_name, |
| 34 | + CASE |
| 35 | + WHEN proname = 'set_username' THEN 'EXISTS' |
| 36 | + ELSE 'OTHER FUNCTION' |
| 37 | + END as status |
| 38 | +FROM pg_proc |
| 39 | +WHERE proname = 'set_username'; |
| 40 | + |
| 41 | +-- 4. List all tables in public schema |
| 42 | +SELECT |
| 43 | + 'All Tables' as check_type, |
| 44 | + table_name, |
| 45 | + 'EXISTS' as status |
| 46 | +FROM information_schema.tables |
| 47 | +WHERE table_schema = 'public' |
| 48 | +ORDER BY table_name; |
| 49 | + |
| 50 | +-- 5. List all functions in public schema |
| 51 | +SELECT |
| 52 | + 'All Functions' as check_type, |
| 53 | + proname as function_name, |
| 54 | + 'EXISTS' as status |
| 55 | +FROM pg_proc |
| 56 | +WHERE pronamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'public') |
| 57 | +ORDER BY proname; |
0 commit comments