Skip to content

Instantly share code, notes, and snippets.

@vlucas
Created July 15, 2013 21:21
Show Gist options
  • Select an option

  • Save vlucas/6003622 to your computer and use it in GitHub Desktop.

Select an option

Save vlucas/6003622 to your computer and use it in GitHub Desktop.
Process for running migrations on a Heroku Rails app

Assumtions: Git repo cloned from remote named "production" (hence the "-r production" flags)

Pane 1:

heroku logs -t -r production

Pane 2:

heroku maintenance:on -r production
heroku ps:scale web=0 -r production

Watch the logs in Pane 1 and make sure requests stop coming in

heroku run rake db:migrate -r production

Make sure everything went well (no errors in either pane)

heroku ps:scale web=2 -r production

Watch the logs in Pane 1 until both apps have started

heroku maintenance:off -r production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment