2

How am I supposed to migrate Rails application database in App Fog?

For example, on Heroku after the first deployment you have to run:

$ heroku run rake db:migrate

Is there a similar command or the database is deployed automatically on App Fog?

P.S. I didn't found documentation for this. Does it configure the database automatically by generating the database.yml file like on Heroku?

Itay Grudev
  • 7,055
  • 4
  • 54
  • 86

2 Answers2

3

There is actually some documentation on here.

Basically, you create a Caldecott tunnel with af tunnel, then run the migration locally.

Joe
  • 290
  • 3
  • 9
  • its the same for running the rails console, what you need to do once you have your tunnel setup and running, is you have to open a new terminal window, and from your project directory run: `RAILS_ENV=proxied-appfog rails console` assuming you have setup a proxied-appfog environment as per the docs https://docs.appfog.com/languages/ruby/rails – GiH Mar 27 '13 at 00:42
0

One option is run af services to see your active services. Then will display the System Services and Provisioned Services, copy your mysql Provisioned Service for your app and run af tunnel my-app-mysql-4234 , where my-app-mysql-4234 is the name of Provisioned Service copied. Now will display 3 options, select 1 (1 option is none). Open other tab o windows terminal and run RAILS_ENV=production rake db:migrate where production is the name in config/database.yml.

Don't forget run RAILS_ENV=production rake db:seed if you need.

If it isn't clear, look this tutorial : http://eftakhairul.com/deploy-your-first-ror-app-at-appfog/

Bye!

CristianOrellanaBak
  • 447
  • 1
  • 5
  • 13