temp: debug migration status endpoint
This commit is contained in:
parent
acb9d66815
commit
7fe60dc1af
1 changed files with 16 additions and 0 deletions
16
src/app/api/debug-migration/route.ts
Normal file
16
src/app/api/debug-migration/route.ts
Normal file
|
|
@ -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) });
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue