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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user