Skip to content

Derive dev/test DB names per app and isolate test DB per worktree#8

Merged
CasJam merged 1 commit into
mainfrom
bc/template-db-naming
May 29, 2026
Merged

Derive dev/test DB names per app and isolate test DB per worktree#8
CasJam merged 1 commit into
mainfrom
bc/template-db-naming

Conversation

@CasJam
Copy link
Copy Markdown
Contributor

@CasJam CasJam commented May 29, 2026

config/database.yml now derives the database name from the repository's own folder name — resolved from the main repo even inside a git worktree via the .git pointer — instead of the hardcoded build_new prefix, so an app forked from this template gets its own databases (coolapp_development, etc.) with no manual edits. The per-worktree suffix is now applied to the test database as well, so parallel bin/rails test runs across worktrees no longer collide on a single shared test DB. Staging/production are named the same way but remain overridden by DATABASE_URL on real deploys. The change is backward compatible for this template, since app_name resolves to build_new (the build-new folder, sanitized). CLAUDE.md is updated to document the new per-app, per-worktree naming.

🤖 Generated with Claude Code

config/database.yml now derives the database name from the repository's
own folder name (the main repo, resolved via the worktree's .git pointer)
instead of the hardcoded "build_new" prefix, so an app forked from this
template gets its own databases with no edits. The per-worktree suffix is
now applied to the test database too, so parallel `bin/rails test` runs
across worktrees no longer collide on a shared test DB.

Backward compatible for this template (app_name resolves to "build_new").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CasJam CasJam merged commit a0711f9 into main May 29, 2026
5 checks passed
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.

1 participant