From 7fe60dc1af804bc9c58adfad0239ae94d2125773 Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 24 May 2026 01:36:10 +0530 Subject: [PATCH] temp: debug migration status endpoint --- src/app/api/debug-migration/route.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/app/api/debug-migration/route.ts diff --git a/src/app/api/debug-migration/route.ts b/src/app/api/debug-migration/route.ts new file mode 100644 index 0000000..37d0819 --- /dev/null +++ b/src/app/api/debug-migration/route.ts @@ -0,0 +1,16 @@ +import { NextResponse } from "next/server"; +import { sql } from "@/db"; + +export async function GET() { + try { + const migrations = await sql.unsafe( + `SELECT hash, created_at FROM __drizzle_migrations ORDER BY created_at DESC LIMIT 10` + ); + const circleTables = await sql.unsafe( + `SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename LIKE 'circle%' ORDER BY tablename` + ); + return NextResponse.json({ migrations, circleTables }); + } catch (err: unknown) { + return NextResponse.json({ error: err instanceof Error ? err.message : String(err) }); + } +}