如何运行schema.rb?

编程入门 行业动态 更新时间:2024-10-11 21:27:16
本文介绍了如何运行schema.rb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试运行 db:migrate.但是,这失败了,因为其中一个迁移尝试更新的表之一不存在.我搜索了代码库,这个表是在 db/schema.rb 中创建的.

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.

如何在 db:migrate 之前运行 schema.rb??

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

推荐答案

使用架构加载任务:

rake db:schema:load

来自 rake -T(删除版本):

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

更多推荐

如何运行schema.rb?

本文发布于:2023-10-18 04:24:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1503093.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:schema   rb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!