我如何知道“rake db:migrate”发生了什么变化?会在申请之前申请吗?

发布于 2024-12-03 07:39:59 字数 177 浏览 5 评论 0原文

命令 rake db:migrate 会将所有相关的新迁移应用到数据库,并在输出中列出已应用的迁移。

我想提前知道将应用哪些迁移,以便记下生产环境中预期的更改列表。

是否有一个选项可以与 rake db:migrate 结合使用,该选项将向我显示将应用哪些更改,而无需实际应用它们?

The command rake db:migrate will apply all relevant new migrations to a database and will list in the output the migrations that were applied.

I'd like to know in advance what migrations will be applied so as to note down a list of the changes that are expected in a production environment.

Is there an option I can use in conjunction to rake db:migrate that will show me what changes will be applied without actually applying them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

巴黎夜雨 2024-12-10 07:39:59

rake db:migrate:status(仅限 Rails 3+)符合要求吗?

Does rake db:migrate:status (rails 3+ only) fit the bill?

蓝戈者 2024-12-10 07:39:59

我想这就是答案: 显示 Rails 中待处理的迁移

如果您使用 capistarno 进行部署,则可以添加与此类似的任务: http://gem-session.com/2010/08/warn-of-pending-migrations-when-deploying-with-capistrano

I guess here's the answer: Show pending migrations in rails .

If you are deploying with capistarno, you could add a task similar to this: http://gem-session.com/2010/08/warn-of-pending-migrations-when-deploying-with-capistrano .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文