import 'dotenv/config'; import path from 'node:path'; import { defineConfig } from 'prisma/config'; // Prisma 7 keeps the connection URL out of the schema file, so it lives here. export default defineConfig({ schema: path.join('prisma', 'schema.prisma'), migrations: { path: path.join('prisma', 'migrations'), seed: 'tsx prisma/seed.ts', }, datasource: { // Read directly rather than through prisma's env() helper, which throws // when the variable is absent. `prisma generate` needs no database and // runs in a build container that has none; `migrate deploy` still fails // loudly on an empty URL, which is where the error belongs. url: process.env.DATABASE_URL ?? '', }, });