问题
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?
回答1:
There is actually some documentation on here.
Basically, you create a Caldecott tunnel with af tunnel
, then run the migration locally.
回答2:
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!
来源:https://stackoverflow.com/questions/13153777/app-fog-rails-migrate-database