File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Database Configuration
2- POSTGRES_USER = " muditor"
3- POSTGRES_PASSWORD = " password"
4- POSTGRES_DB = " fierydev"
5- POSTGRES_HOST = " localhost"
6- POSTGRES_PORT = " 5432"
7-
8- DATABASE_URL = " postgresql://${ POSTGRES_USER } :${ POSTGRES_PASSWORD } @${ POSTGRES_HOST } :${ POSTGRES_PORT } /${ POSTGRES_DB } "
9- DATABASE_URL_TEST = " postgresql://${ POSTGRES_USER } :${ POSTGRES_PASSWORD } @${ POSTGRES_HOST } :${ POSTGRES_PORT } /muditor_test"
2+ DATABASE_URL = " postgresql://muditor:password@localhost:5432/fierydev"
3+ DATABASE_URL_TEST = " postgresql://muditor:password@localhost:5432/muditor_test"
104
115# Redis Configuration (for subscriptions and caching)
126REDIS_URL = " redis://localhost:6379"
@@ -65,4 +59,7 @@ RATE_LIMIT_WINDOW=900000 # 15 minutes
6559# Features Flags
6660ENABLE_SCRIPT_SANDBOX = true
6761ENABLE_REAL_TIME = true
68- ENABLE_FILE_UPLOAD = true
62+ ENABLE_FILE_UPLOAD = true
63+
64+ # Prisma schema path (shared between fierylib and muditor)
65+ PRISMA_SCHEMA_PATH = " ./packages/db/prisma/schema.prisma"
Original file line number Diff line number Diff line change @@ -3,18 +3,19 @@ import fs from 'node:fs';
33import path from 'node:path' ;
44import { defineConfig } from 'prisma/config' ;
55
6- // Resolve schema absolutely so running `prisma` from repo root or this package works.
7- const schema = path . resolve ( __dirname , 'prisma' , 'schema.prisma' ) ;
8-
9- // Load only the repository root .env file explicitly because Prisma skips auto-loading when using prisma.config.ts.
6+ // Load env first so PRISMA_SCHEMA_PATH is available
107// packages/db -> repo root (two levels up)
11- // Note: Don't override existing env vars - docker-compose sets DATABASE_URL correctly for containers
128const repoRoot = path . resolve ( __dirname , '../..' ) ;
139const rootEnv = path . join ( repoRoot , '.env' ) ;
1410if ( fs . existsSync ( rootEnv ) ) {
1511 dotenv . config ( { path : rootEnv , override : false } ) ;
1612}
1713
14+ // Resolve schema path - use PRISMA_SCHEMA_PATH from env if set, otherwise default
15+ const schema = process . env . PRISMA_SCHEMA_PATH
16+ ? path . resolve ( repoRoot , process . env . PRISMA_SCHEMA_PATH )
17+ : path . resolve ( __dirname , 'prisma' , 'schema.prisma' ) ;
18+
1819if ( ! process . env . DATABASE_URL ) {
1920 // Throw a descriptive error early so Prisma doesn't emit a generic P1012 later.
2021 throw new Error (
Original file line number Diff line number Diff line change 1- import { defineConfig } from "prisma" ;
1+ import dotenv from 'dotenv' ;
2+ import { defineConfig } from 'prisma' ;
3+
4+ // Load .env for PRISMA_SCHEMA_PATH
5+ dotenv . config ( ) ;
26
37export default defineConfig ( {
4- schema : "./packages/db/prisma/schema.prisma" ,
5- } ) ;
8+ schema :
9+ process . env . PRISMA_SCHEMA_PATH || './packages/db/prisma/schema.prisma' ,
10+ } ) ;
You can’t perform that action at this time.
0 commit comments