summaryrefslogtreecommitdiff
path: root/apps/web/drizzle.config.ts
blob: 87547bd04cd1bfcbe809250285460fae5a020a99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import type { Config } from "drizzle-kit";
import * as dotenv from "dotenv";
import { env } from "@/env";

// Load the right env file based on environment
if (env.NODE_ENV === "production") {
  dotenv.config({ path: ".env.production" });
} else {
  dotenv.config({ path: ".env.local" });
}

export default {
  schema: "../../packages/db/src/schema.ts",
  dialect: "postgresql",
  dbCredentials: {
    url: env.DATABASE_URL,
  },
  out: "./migrations",
  strict: env.NODE_ENV === "production",
} satisfies Config;