// Standalone init/migration entry point: `npm run db:migrate`. // Prisma Migrate (prisma/migrations) is now the source of truth for the // schema — this just delegates to `prisma migrate deploy`, which applies // any pending migrations against DATABASE_URL. Replaces the old // src/lib/db.ts's manual `CREATE TABLE IF NOT EXISTS` runner. // Requires DATABASE_URL to point at a reachable Postgres (see // docker-compose.yml / .env.example). import { execSync } from "node:child_process"; function main(): void { execSync("npx prisma migrate deploy", { stdio: "inherit" }); const { host, pathname } = new URL(process.env.DATABASE_URL as string); console.log(`Migrations applied. Database ready at ${host}${pathname}`); } main();