fix: use real DATABASE_URL from .env for migrations in deploy workflow
The deploy job was overwriting DATABASE_URL with a placeholder for prisma:generate, but this persisted when db:migrate ran later, causing ER_ACCESS_DENIED_ERROR. Since the stage directory already symlinks to the live .env, the real DATABASE_URL is available without override.
This commit is contained in:
1 parent
525f58cd24
commit
822dfd6a1c
1 file changed
+4
-4
@@ -335,10 +335,10 @@ jobs:
|
||||
export DATABASE_POOL_SIZE="${DEPLOY_DATABASE_POOL_SIZE:-5}"
|
||||
echo "STAGE DATABASE_POOL_SIZE=${DATABASE_POOL_SIZE}"
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
export DATABASE_URL="${DEPLOY_DATABASE_URL:-mysql://placeholder:please@localhost/placeholder}"
|
||||
# prisma generate does not need a live DB connection.
|
||||
pnpm prisma:generate
|
||||
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.
|
||||
pnpm prisma:generate
|
||||
export BCRYPT_ROUNDS=4
|
||||
pnpm typecheck
|
||||
# Validate production env (AUTH_SECRET, DATABASE_URL, …) during build.
|
||||
|
||||
Reference in new issue
Block a user