Skip to content

Instantly share code, notes, and snippets.

@cesarferreira
Last active December 23, 2015 02:29
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 cesarferreira/6567233 to your computer and use it in GitHub Desktop.
Save cesarferreira/6567233 to your computer and use it in GitHub Desktop.
Bunch of useful commands for rails / heroku
#!/bin/sh
# Reset local Database
bundle exec rake db:reset
# Migrate local Database
bundle exec rake db:drop
# Create local Database
bundle exec rake db:create
# Migrate local Database
bundle exec rake db:migrate
# Scaffolding
rails g scaffold Videos title:string views:integer
#### HEROKU ####
# Migrate database on Heroku
heroku run rake db:migrate
# Reset remote database on Heroku
heroku pg:reset DATABASE_URL --confirm APP_NAME
heroku run rake db:reset --confirm APP_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment