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

// Load the right env file based on environment
if (process.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: process.env.DATABASE_URL!,
	},
	out: "./migrations",
	strict: process.env.NODE_ENV === "production",
} satisfies Config;