-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-db.js
More file actions
29 lines (23 loc) · 945 Bytes
/
Copy pathcheck-db.js
File metadata and controls
29 lines (23 loc) · 945 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
const { createClient } = require('@supabase/supabase-js')
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY
if (!supabaseUrl || !supabaseKey) {
console.error('Missing env vars')
process.exit(1)
}
const supabase = createClient(supabaseUrl, supabaseKey)
async function check() {
console.log('Checking wishlists table...')
const { data, error } = await supabase.from('wishlists').select('count', { count: 'exact', head: true })
if (error) {
console.error('Error accessing wishlists table:', error.message) // Log just message
if (error.message && error.message.includes('relation "public.wishlists" does not exist')) {
console.log('CONFIRMED: Table missing.')
} else {
console.log('Error is NOT missing table:', error)
}
} else {
console.log('Wishlists table exists.')
}
}
check()