Skip to content

docs: require packages/db/.env before self-host migrations - #2

Open
ShahNewazKhan wants to merge 1 commit into
superloglabs:mainfrom
ShahNewazKhan:docs/selfhost-db-env
Open

docs: require packages/db/.env before self-host migrations#2
ShahNewazKhan wants to merge 1 commit into
superloglabs:mainfrom
ShahNewazKhan:docs/selfhost-db-env

Conversation

@ShahNewazKhan

@ShahNewazKhan ShahNewazKhan commented Aug 29, 2026

Copy link
Copy Markdown

What

Adds a missing setup step to the self-hosting guide.

The Run database migrations step ran pnpm --filter @superlog/db db:migrate without any way for the drizzle config to obtain DATABASE_URL, so it failed on a fresh self-hosted checkout with:

Error  Please provide required params for Postgres driver:
    [x] url: ''

Fix

Insert a Configure the database URL step (before migrations) instructing users to copy the bundled env template:

cp packages/db/.env.example packages/db/.env

and note that any custom Postgres credentials/ports in docker-compose.yml should be mirrored in packages/db/.env.

Related

Pairs with the code change in superloglabs/superlog#489, which makes the drizzle config read DATABASE_URL from packages/db/.env.


Summary by cubic

Adds a missing setup step to the self-hosting guide so db:migrate no longer fails on a fresh checkout. The guide now instructs users to copy packages/db/.env.example to packages/db/.env before running migrations, and notes that any custom Postgres credentials or port in docker-compose.yml should be mirrored there.

Written for commit 55a8994. Summary will update on new commits.

Review in cubic

The self-hosting setup step ran db:migrate with no DATABASE_URL, which
failed with "Please provide required params for Postgres driver: url: ''"
unless packages/db/.env (or another env source) was created first. Add a
step that copies the bundled .env.example into packages/db/.env, and note
that changed compose credentials should be mirrored there.
Copilot AI lite review requested due to automatic review settings August 29, 2026 16:16

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new step currently states as fact that Superlog reads DATABASE_URL from packages/db/.env, which can be inaccurate depending on the paired code change/version and should be phrased as a general requirement with supported sources.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the self-hosting guide to prevent fresh-checkout database migrations from failing due to missing DATABASE_URL configuration.

Changes:

  • Adds a new step to create packages/db/.env from packages/db/.env.example before running migrations.
  • Extends the migrations step with guidance to keep DATABASE_URL in sync with any custom Postgres settings in docker-compose.yml.
File summaries
File Description
self-hosting.mdx Inserts a database URL configuration step ahead of migrations and adds a note about aligning .env with Compose credentials/port.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread self-hosting.mdx
</Step>

<Step title="Configure the database URL">
Point the database package at the Postgres started by Compose. Superlog reads `DATABASE_URL` from `packages/db/.env`, so create it from the included example (the defaults already match the Compose Postgres):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants