Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<% branch_name = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') %>
<% repository_name = `git rev-parse --show-toplevel`.split('/').last.strip %>
# Check https://gist.github.com/neerajdotname/b9d53f8a234da9d8c007de5e3d98bc21 to see
# details about the restriction on database name
# If you prefer to have branch name in the database name then use following
# database: <%= "#{repository_name}_development_#{branch_name}"[0...63] %>
development:
adapter: postgresql
encoding: unicode
database: <%= "#{repository_name}_development"[0...63] %>
username: neerajsingh
password:
pool: 5
test:
adapter: postgresql
encoding: unicode
database: <%= "#{repository_name}_test"[0...63] %>
pool: 5
username: neerajsingh
password:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment