How to update production database schema safely in rails 3.1.3?

浪子不回头ぞ 提交于 2019-12-13 05:32:45

问题


We need constantly update our database schema in production for rails 3.1.3 app. The first db schema was created with the following rails command:

$rake RAILS_ENV=production db:schema:load

Question is: can we still use the command above to update db schema in production while safely retaining all current data?

Thanks so much.


回答1:


I never used rake db:schema:load in production, but according to this answer to another question here on SO, I don't think you want to do that.

On the other hand, I have used RAILS_ENV=production rake db:migrate several times on the server with data already in the database and never experienced any problems.



来源:https://stackoverflow.com/questions/10131049/how-to-update-production-database-schema-safely-in-rails-3-1-3

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