Accept DB_DATABASE (Coolify convention) in addition to DB_NAME

Coolify auto-injected env vars from an attached Postgres use DB_DATABASE,
but the cotizador code read DB_NAME. Now both are accepted (DB_DATABASE
takes priority) across db.ts, seed.ts, and prisma.config.ts so attaching a
managed Postgres in Coolify Just Works.
This commit is contained in:
urieljareth
2026-07-07 23:17:15 -06:00
parent 2157de6b89
commit e1f3263c9f
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ function databaseUrl(): string {
const port = process.env["DB_PORT"] || "5432";
const user = encodeURIComponent(process.env["DB_USER"] || "postgres");
const password = encodeURIComponent(process.env["DB_PASSWORD"] || "postgres");
const name = process.env["DB_NAME"] || "cotizador_e3";
const name = process.env["DB_DATABASE"] || process.env["DB_NAME"] || "cotizador_e3";
return `postgresql://${user}:${password}@${host}:${port}/${name}`;
}