From fe46bd054461b687a99ed2203708561e323270e5 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 30 Jul 2026 20:20:39 +0200 Subject: [PATCH] fix: unset placeholder DATABASE_URL after prisma:generate so build/migrate use real .env prisma:generate needs DATABASE_URL to resolve the schema but doesn't connect to the DB. After generate, unset the placeholder so that pnpm build and pnpm db:migrate pick up the real DATABASE_URL from the live .env (symlinked into the stage directory). --- .gitea/workflows/deploy.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 126f88576f..026cc0771f 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -336,9 +336,12 @@ jobs: echo "STAGE DATABASE_POOL_SIZE=${DATABASE_POOL_SIZE}" pnpm install --frozen-lockfile - # Stage symlinks to live .env, so DATABASE_URL is already the real value. - # prisma generate only needs the URL for client generation — no live DB connection. + # prisma generate only needs DATABASE_URL to resolve the schema — no live DB connection. + # Use a placeholder so it doesn't fail if .env isn't loaded yet; db:migrate later + # will use the real DATABASE_URL from the live .env symlink. + export DATABASE_URL="mysql://placeholder:please@localhost/placeholder" pnpm prisma:generate + unset DATABASE_URL export BCRYPT_ROUNDS=4 pnpm typecheck # Validate production env (AUTH_SECRET, DATABASE_URL, …) during build.