fix: pass DB_PASSWORD to postgres client in sync script

The sync script created its own postgres client and only read DATABASE_URL,
bypassing the DB_PASSWORD override that lib/db/index.ts already applied.
Since DATABASE_URL has no password embedded, auth always failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 16:43:50 +02:00
parent 9a87e9dde3
commit 2b22f504cf
+4 -1
View File
@@ -73,7 +73,10 @@ function parseScore(score: RawScore | undefined) {
} }
async function run() { async function run() {
const client = postgres(DATABASE_URL, { max: 5 }) const client = postgres(DATABASE_URL, {
max: 5,
...(process.env.DB_PASSWORD ? { password: process.env.DB_PASSWORD } : {}),
})
const db = drizzle(client) const db = drizzle(client)
console.log('Creating tables...') console.log('Creating tables...')