// Prisma 7 config — usado pelo CLI (migrate, generate, studio).
// Conexão de runtime fica no WorkspacePrismaPool (adapter por workspace).
// CODING-RULES PGD-DB-001: DATABASE_URL aponta direto ao PG na porta 5432 (sem PgBouncer).

import path from 'node:path';
import { defineConfig } from 'prisma/config';

export default defineConfig({
  schema: path.join(import.meta.dirname, 'prisma/schema.prisma'),
  datasource: {
    // Prisma 7: url aqui serve apenas para o CLI (migrate/generate/studio).
    // Runtime usa WorkspacePrismaPool → PrismaClient({ adapter: new PrismaPg(pool) }).
    url: process.env['DATABASE_URL'],
  },
});
