Files

24 lines
574 B
TypeScript
Raw Permalink Normal View History

2025-07-24 14:41:34 -07:00
import type { Config } from "drizzle-kit";
import * as dotenv from "dotenv";
2026-01-31 00:20:04 +01:00
import { webEnv } from "@opencut/env/web";
2025-07-24 14:41:34 -07:00
// Load the right env file based on environment
2026-01-31 00:20:04 +01:00
if (webEnv.NODE_ENV === "production") {
2025-07-24 14:41:34 -07:00
dotenv.config({ path: ".env.production" });
} else {
dotenv.config({ path: ".env.local" });
}
export default {
2026-01-31 00:20:04 +01:00
schema: "./src/schema.ts",
2025-07-24 14:41:34 -07:00
dialect: "postgresql",
2026-01-31 00:20:04 +01:00
migrations: {
table: "drizzle_migrations",
},
2025-07-24 14:41:34 -07:00
dbCredentials: {
2026-01-31 00:20:04 +01:00
url: webEnv.DATABASE_URL,
2025-07-24 14:41:34 -07:00
},
out: "./migrations",
2026-01-31 00:20:04 +01:00
strict: webEnv.NODE_ENV === "production",
2025-07-24 14:41:34 -07:00
} satisfies Config;