Created
May 23, 2014 15:03
-
-
Save nthj/b59d5c2cc8f3ef868243 to your computer and use it in GitHub Desktop.
Automatically create a new database for each of your development branches
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
#!/bin/bash | |
set -e | |
printf '\npost-checkout hook\n\n' | |
if [[ $3 == 1 ]]; then | |
echo "Creating `git name-rev --name-only $2`" | |
createdb "ticketbud_`git name-rev --name-only $2`_development" | |
createdb "ticketbud_`git name-rev --name-only $2`_test" | |
rake db:abort_if_pending_migrations || rake db:schema:load | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment