import path from 'node:path'
import { config as loadEnv } from 'dotenv'
import { defineConfig, env } from '@prisma/config'

// Load .env.local first (dev), fallback to .env (prod)
// Prisma CLI doesn't load .env.local like Next.js does
loadEnv({ path: '.env.local' })
loadEnv({ path: '.env' })

export default defineConfig({
    schema: path.join('prisma', 'schema.prisma'),
    datasource: {
        url: env('DATABASE_URL'),
    },
})
