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

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

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