App Fog Rails Migrate Database

你。 提交于 2019-12-11 02:18:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!