Reputation: 12650
I've been trying to setup my first rails app--I'm okay at stumbling around on my local machine (OSX) and finding out how to do stuff...
I want to setup my local machine to deploy on Heroku.
I have a heroku account, and rails running on my mac...how do I get the database setup for both my local config and heroku? I have MySql locally, but it looks like heroku uses Postgre...
Can you give me a step-by-step process so that I can get to making my app and forget about server config?! :)
Upvotes: 1
Views: 716
Reputation: 619
First, you would setup your database.yml file to use your MySQL on your local machine for development. Set this up however you like, a good example is http://wiki.rubyonrails.org/database-support/mysql#databaseyml_example
And than when you are ready to migrate your development database from your local machine, you would run:
heroku db:push
This will export your MySQL, SQLite or Postgres DB on your development machine and import it into your heroku instance. Your heroku instance will overwrite your database.yml file with the correct Postgres info and your application will have your development schema in the heroku Postgres DB.
Upvotes: 0
Reputation: 4746
If you're not already using it, check out Michael Hartl's Ruby on Rails Tutorial.
Germane to your question: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:deploying
Edited because I apparently forgot how to spell germane...
Upvotes: 0
Reputation: 185
You should be ok if you havent written any mysql specific code. Rails handles converting the rails model/controller code to whatever database you are using. As it says here, you are probably going to want to type:
heroku db:push
to set up your database using the schema and import the data from your local database.
Upvotes: 1