Skip to content

Instantly share code, notes, and snippets.

@brandondrew
Created February 5, 2009 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandondrew/58549 to your computer and use it in GitHub Desktop.
Save brandondrew/58549 to your computer and use it in GitHub Desktop.
Never forget to run your migrations again
# add this to your .bash_profile or your .zshrc or whatever
# then use sg (or your preferred abbreviation) instead of script/generate
# and never forget to run migrations again
function sg() {
script/generate $@
echo "Would you like to run the migrations right now?"
read CHOICE
if [ "$CHOICE" = "y" ] || [ "$CHOICE" = "yes" ]
then
echo "rake db:migrate" && rake db:migrate
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment