Compare commits

...
Author SHA1 Message Date
ephraimduncan 02166af7eb fix: remove the direct url fallback from the migrate script
The fallback uses POSIX shell syntax, but npm on Windows runs scripts in cmd.exe. docker/start.sh keeps the fallback for Docker, and the manual guide sets the two variables.
2026-09-28 10:39:50 +00:00
ephraimduncan a3fbd791de docs: remove the npx migration command that cannot find the schema
From the repository root, `npx prisma migrate deploy` stops with "Could
not find Prisma Schema". It also does not use the fallback for
`NEXT_PRIVATE_DIRECT_DATABASE_URL`. The `npm run prisma:migrate-deploy`
command above it does the same work and uses the fallback.
2026-09-28 10:23:30 +00:00
ephraimduncan 5874b8f8c4 fix: set the direct url for manual migrations
`npm run prisma:migrate-deploy` stopped with error P1012 when
`NEXT_PRIVATE_DIRECT_DATABASE_URL` was not set. If the direct URL is
empty, the script uses `NEXT_PRIVATE_DATABASE_URL`, the same as the
Docker start script.

The manual migration command in the upgrade guide does not use the start
script, and Prisma cannot find the schema at the default path in the
image. The command sets the two variables and gives the path to the
schema.
2026-09-28 10:17:35 +00:00
ephraimduncan c66270ad9d 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.
2026-09-28 09:38:46 +00:00
3 changed files with 5 additions and 4 deletions
@@ -191,9 +191,6 @@ For manual deployments or troubleshooting:
```bash
# Apply pending migrations
npm run prisma:migrate-deploy
# Or using npx directly
npx prisma migrate deploy
```
<Callout type="info">
@@ -426,8 +426,9 @@ docker pull documenso/documenso:<version>
# Run migrations only
docker run --rm \
-e NEXT_PRIVATE_DATABASE_URL="postgresql://user:password@host:5432/documenso" \
-e NEXT_PRIVATE_DIRECT_DATABASE_URL="postgresql://user:password@host:5432/documenso" \
documenso/documenso:<version> \
npx prisma migrate deploy
npx prisma migrate deploy --schema ../../packages/prisma/schema.prisma
```
<Callout type="warn">
+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