Skip to content

Instantly share code, notes, and snippets.

@craigmcnamara
Last active January 25, 2023 12:57
Show Gist options
  • Save craigmcnamara/7ae748806133941d438d872a4575a865 to your computer and use it in GitHub Desktop.
Save craigmcnamara/7ae748806133941d438d872a4575a865 to your computer and use it in GitHub Desktop.
Database per branch
# To enable a per branch DBs, go to .env and add `DB_PER_BRANCH=true`
<% branch_suffix = ENV["DB_PER_BRANCH"] ? ("--" + `git rev-parse --abbrev-ref HEAD`.chomp)&.gsub(/\./, '')&.split('/')&.last : "" %>
development:
database: app_development<%= branch_suffix %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment