Spaces:
Running
Running
Simeon Garratt
feat: redesign landing page with floating tiles, hero pillars, scoring transparency
7b22979 | /** | |
| * One-time script to clear all leaderboard and game_sessions data. | |
| * Run with: node scripts/clear-data.mjs | |
| */ | |
| import { createClient } from "@supabase/supabase-js"; | |
| const url = "https://xsoaahyztsmncffkmodn.supabase.co"; | |
| const key = process.env.SUPABASE_SERVICE_ROLE_KEY; | |
| if (!key) { | |
| console.error("SUPABASE_SERVICE_ROLE_KEY not set. Run with:"); | |
| console.error(" SUPABASE_SERVICE_ROLE_KEY=... node scripts/clear-data.mjs"); | |
| process.exit(1); | |
| } | |
| const supabase = createClient(url, key); | |
| async function clearTable(table) { | |
| const { error } = await supabase.from(table).delete().neq("id", "00000000-0000-0000-0000-000000000000"); | |
| if (error) { | |
| console.error(`Failed to clear ${table}:`, error.message); | |
| } else { | |
| console.log(`Cleared: ${table}`); | |
| } | |
| } | |
| await clearTable("leaderboard"); | |
| await clearTable("game_sessions"); | |
| console.log("Done -- fresh start."); | |