refactor packages, env, db and auth (prev commit)

This commit is contained in:
Maze Winther
2025-11-26 10:12:40 +01:00
parent 811491ba9c
commit 2da84e7132
25 changed files with 202 additions and 158 deletions
+23
View File
@@ -0,0 +1,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;