mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
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:
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
output = "../frontends/nextjs/node_modules/.prisma/client"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
|
||||
Reference in New Issue
Block a user