docs: require packages/db/.env before self-host migrations - #2
Open
ShahNewazKhan wants to merge 1 commit into
Open
docs: require packages/db/.env before self-host migrations#2ShahNewazKhan wants to merge 1 commit into
ShahNewazKhan wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
🟡 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/.envfrompackages/db/.env.examplebefore running migrations. - Extends the migrations step with guidance to keep
DATABASE_URLin sync with any custom Postgres settings indocker-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.
| </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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a missing setup step to the self-hosting guide.
The
Run database migrationsstep ranpnpm --filter @superlog/db db:migratewithout any way for the drizzle config to obtainDATABASE_URL, so it failed on a fresh self-hosted checkout with:Fix
Insert a
Configure the database URLstep (before migrations) instructing users to copy the bundled env template:and note that any custom Postgres credentials/ports in
docker-compose.ymlshould be mirrored inpackages/db/.env.Related
Pairs with the code change in superloglabs/superlog#489, which makes the drizzle config read
DATABASE_URLfrompackages/db/.env.Summary by cubic
Adds a missing setup step to the self-hosting guide so
db:migrateno longer fails on a fresh checkout. The guide now instructs users to copypackages/db/.env.exampletopackages/db/.envbefore running migrations, and notes that any custom Postgres credentials or port indocker-compose.ymlshould be mirrored there.Written for commit 55a8994. Summary will update on new commits.