Last active
September 1, 2020 10:57
-
-
Save neerajsingh0101/fa7096b327519aa3028a4045c52bee62 to your computer and use it in GitHub Desktop.
This file contains 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
<% 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 | |
database: <%= "#{repository_name}_development"[0...63] %> | |
host: localhost | |
pool: 5 | |
test: | |
adapter: postgresql | |
database: <%= "#{repository_name}_test"[0...63] %> | |
host: localhost | |
pool: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment