Fix Prisma client generation in CI/CD

- Fix import path from 'prisma/config' to '@prisma/config' in prisma.config.ts
- Add proper output path to generator in schema.prisma for monorepo structure
- Make dotenv import optional with try/catch for CI environments
- Prisma client now generates successfully in frontends/nextjs/node_modules/.prisma/client

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-27 16:39:50 +00:00
parent 6db635e3bc
commit def61b1da3
2 changed files with 10 additions and 2 deletions

View File

@@ -4,8 +4,15 @@
* This file replaces the deprecated package.json#prisma configuration.
* See: https://www.prisma.io/docs/orm/reference/prisma-config-reference
*/
import 'dotenv/config'
import { defineConfig } from 'prisma/config'
// Try to load dotenv, but don't fail if it's not available (e.g., in CI)
try {
// @ts-ignore - dotenv might not be available
await import('dotenv/config')
} catch {
// Dotenv not available or failed - that's okay, DATABASE_URL might be set directly
}
import { defineConfig } from '@prisma/config'
export default defineConfig({
// Schema is in the repo root prisma/ directory

View File

@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
output = "../frontends/nextjs/node_modules/.prisma/client"
}
datasource db {