BangSo/packages/db/prisma.config.ts

21 lines
590 B
TypeScript
Raw Permalink Normal View History

2026-09-01 16:51:19 +00:00
import { existsSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { config } from "dotenv";
import { defineConfig } from "prisma/config";
const here = path.dirname(fileURLToPath(import.meta.url));
const rootEnv = path.resolve(here, "../../.env");
if (existsSync(rootEnv)) config({ path: rootEnv });
config();
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
},
datasource: {
url: process.env.DATABASE_URL ?? "postgres://rakazo:rakazo@127.0.0.1:5433/rakazo",
},
});