Created
June 11, 2013 16:11
-
-
Save pkqk/5758229 to your computer and use it in GitHub Desktop.
use a database based on branch name then when you make a new branch
rake db:{create,migrate,seed}
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
| database: &database | |
| adapter: # your database | |
| hostname: localhost | |
| username: root | |
| password: | |
| encoding: utf8 | |
| development: | |
| <<: *database | |
| <% branch_name = `git symbolic-ref HEAD`.strip.split('/')[-1] %> | |
| <% unless %w[master production staging].include?(branch_name) %> | |
| database: appname_<%= branch_name %> | |
| <% else %> | |
| database: appname_development | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment