ab4db641b0
Adds the Prisma schema (Request/Job models, RequestStatus/JobState enums), a Prisma client singleton at web/src/lib/db.ts, and the init_request_job migration, applied and verified against Postgres. Also publishes the db service's port (5432:5432) in docker-compose.yml so host-run Prisma commands can reach localhost:5432 for local dev.
8 lines
270 B
TypeScript
8 lines
270 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
|
|
const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient };
|
|
|
|
export const prisma = globalForPrisma.prisma ?? new PrismaClient();
|
|
|
|
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
|