Derive dev/test DB names per app and isolate test DB per worktree#8
Merged
Conversation
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>
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.
config/database.ymlnow derives the database name from the repository's own folder name — resolved from the main repo even inside a git worktree via the.gitpointer — instead of the hardcodedbuild_newprefix, 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 parallelbin/rails testruns across worktrees no longer collide on a single shared test DB. Staging/production are named the same way but remain overridden byDATABASE_URLon real deploys. The change is backward compatible for this template, sinceapp_nameresolves tobuild_new(thebuild-newfolder, sanitized).CLAUDE.mdis updated to document the new per-app, per-worktree naming.🤖 Generated with Claude Code