27 lines
597 B
TypeScript
27 lines
597 B
TypeScript
import { defineConfig } from "drizzle-kit";
|
|
import process from "node:process";
|
|
|
|
const dbUrl = (() => {
|
|
const fromProcess = process.env.POSTGRES_OPTIONS;
|
|
const fromDeno = typeof Deno !== "undefined"
|
|
? Deno.env.get("POSTGRES_OPTIONS")
|
|
: undefined;
|
|
return fromProcess ?? fromDeno;
|
|
})();
|
|
|
|
if (!dbUrl) {
|
|
throw new Error("POSTGRES_OPTIONS environment variable is required");
|
|
}
|
|
|
|
export default defineConfig({
|
|
schema: "./db/schema.ts",
|
|
out: "./drizzle",
|
|
dialect: "postgresql",
|
|
dbCredentials: {
|
|
url: dbUrl,
|
|
},
|
|
schemaFilter: ["public"],
|
|
strict: true,
|
|
verbose: true,
|
|
});
|