how to run schema.rb?

家住魔仙堡 提交于 2020-08-21 10:06:28

问题


I'm trying to run db:migrate. This fails however because one of the tables that one of the migrations is trying to update does not exist. I searched the codebase and this table is created in db/schema.rb.

How can I run schema.rb before db:migrate??


回答1:


Use the schema load task:

rake db:schema:load

From rake -T (expurgated version):

rake db:schema:dump  # Create db/schema.rb file usable with any AR-supported DB
rake db:schema:load  # Load schema.rb file into DB


来源:https://stackoverflow.com/questions/8823252/how-to-run-schema-rb

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