diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-06-22 13:07:02 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-06-22 13:07:02 +0200 |
| commit | be970248686c0af7d8506cba8c64bf507419da3d (patch) | |
| tree | 3fd8a716b7adae452f1be6dcdd946533da47ad8a /apps/web/drizzle.config.ts | |
| parent | f2d27e578e6214598d36779f44fb1612764c7b3b (diff) | |
| download | opencut-be970248686c0af7d8506cba8c64bf507419da3d.tar.gz | |
so much stuff???
Diffstat (limited to 'apps/web/drizzle.config.ts')
| -rw-r--r-- | apps/web/drizzle.config.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/web/drizzle.config.ts b/apps/web/drizzle.config.ts new file mode 100644 index 00000000..37ff3cc1 --- /dev/null +++ b/apps/web/drizzle.config.ts @@ -0,0 +1,23 @@ +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" });
+}
+
+if (!process.env.DATABASE_URL) {
+ throw new Error("DATABASE_URL is not set");
+}
+
+export default {
+ schema: "./src/lib/db/schema.ts",
+ dialect: "postgresql",
+ dbCredentials: {
+ url: process.env.DATABASE_URL,
+ },
+ out: "./migrations",
+ strict: process.env.NODE_ENV === "production",
+} satisfies Config;
|
