diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-31 19:35:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-31 19:35:17 +0900 |
| commit | f211ebcfac0a21e264b67c1226509896a11ed5ca (patch) | |
| tree | 502c10bbebe041c439a54b3fd08a5b90b5be4429 /drizzle.config.ts | |
| parent | 594482a280279149cbf5cb8b8d086961e65b0fb0 (diff) | |
| download | kioku-f211ebcfac0a21e264b67c1226509896a11ed5ca.tar.gz kioku-f211ebcfac0a21e264b67c1226509896a11ed5ca.tar.zst kioku-f211ebcfac0a21e264b67c1226509896a11ed5ca.zip | |
refactor(db): replace DATABASE_URL with individual POSTGRES_* env vars
Eliminates duplicate configuration by building the connection URL
from POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, POSTGRES_HOST,
and POSTGRES_PORT instead of requiring a separate DATABASE_URL.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'drizzle.config.ts')
| -rw-r--r-- | drizzle.config.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drizzle.config.ts b/drizzle.config.ts index 6fe73ec..0520eb6 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,15 +1,12 @@ import { defineConfig } from "drizzle-kit"; -const databaseUrl = process.env.DATABASE_URL; -if (!databaseUrl) { - throw new Error("DATABASE_URL environment variable is not set"); -} +const { POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, POSTGRES_HOST, POSTGRES_PORT } = process.env; export default defineConfig({ out: "./drizzle", schema: "./src/server/db/schema.ts", dialect: "postgresql", dbCredentials: { - url: databaseUrl, + url: `postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}`, }, }); |
