import { defineConfig } from "prisma/config";

// Default connection for local development (matches docker/dev/docker-compose.yml)
const DEFAULT_DATABASE_URL = "postgresql://dev:dev@localhost:5432/portal_dev";

/**
 * Prisma 7 Configuration
 *
 * Centralized configuration for Prisma CLI commands (migrate, studio, etc.)
 * Runtime adapter is configured in PrismaService, not here.
 *
 * @see https://www.prisma.io/docs/orm/reference/prisma-config-reference
 * @see https://www.prisma.io/docs/orm/prisma-schema/overview/data-sources
 */
export default defineConfig({
  schema: "./schema.prisma",
  // Database connection for CLI commands (migrate, studio, etc.)
  datasource: {
    url: process.env.DATABASE_URL || DEFAULT_DATABASE_URL,
  },
});
