views:

84

answers:

4

I've been learning Ruby on Rails whilst making my first app for a couple of months now, and it's finally ready to start to be used by a few unlucky friends as beta testers. Problem is, I have no idea as to how to move from development to production. The app is on Heroku, and up to this point I've just been pushing the local development database to Heroku whenever I push the app.

I know I'm supposed to create a production database to put on Heroku, but how do I do this? Is there a guide somewhere? How do I manage the production database once it's on Heroku, if I need to run migrations on it?

Thanks for reading

+1  A: 

See http://docs.heroku.com/database

John Topley
+1  A: 

heroku db:reset - remove all existing data heroku rake db:migrate - Run your migrations.

Ian Purton
+2  A: 

If your migrations are broken and you can't do what Ian suggested, you can always compose a bare initial production database locally and then push it up to Heroku. db:push can take an argument to specify an alternate database to push.

But the way to manage the db on production is through heroku rake and heroku console. You can do pretty much anything you'd do locally through rake or the console.

tfe
A: 

Also worth noting that Heroku creates its own database.yml entries for production for you automatically. No need to push your own to their git repo.

Joost Schuur