fix(backend): load DATABASE_URL for Prisma CLI from repo root .env

Use dotenv-cli for db:push, db:seed, db:studio, and migrate:deploy so they
match the API (root .env). Load dotenv in seed.ts for direct runs.
Document absolute DATABASE_URL in .env.example.

Made-with: Cursor
This commit is contained in:
Michilis
2026-04-01 20:01:56 +00:00
parent 8cdf0231ce
commit 51fe1497ae
4 changed files with 127 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
import dotenv from 'dotenv';
import path from 'path';
import { PrismaClient } from '@prisma/client';
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
const prisma = new PrismaClient();
async function main() {