fix: use the database url when the direct url is not set

The Docker start script runs Prisma migrations. The Prisma schema reads
`NEXT_PRIVATE_DIRECT_DATABASE_URL`, and the migrations stopped with error
P1012 when the variable was not set.

If the variable is empty, the start script sets it to
`NEXT_PRIVATE_DATABASE_URL`. This agrees with the documentation and with
docker/production/compose.yml.
This commit is contained in:
ephraimduncan
2026-09-28 09:38:46 +00:00
parent a1d4bec143
commit c66270ad9d
+3
View File
@@ -24,6 +24,9 @@ printf "🏥 Health check: http://localhost:3000/api/health\n"
printf "📊 Certificate status: http://localhost:3000/api/certificate-status\n"
printf "👥 Community: https://github.com/documenso/documenso\n\n"
# The Prisma schema requires a direct URL. Without a connection pooler, it is the same as the database URL.
export NEXT_PRIVATE_DIRECT_DATABASE_URL="${NEXT_PRIVATE_DIRECT_DATABASE_URL:-$NEXT_PRIVATE_DATABASE_URL}"
printf "🗄️ Running database migrations...\n"
npx prisma migrate deploy --schema ../../packages/prisma/schema.prisma