为什么 rake db:migrate 不报告版本号?
rake 0.8.7、rails/activerecord 2.3.3
rake db 的输出:migrate:
== CreateProducts: 迁移 ============================= ===================== -- 创建表(:产品) -> 0.0017秒 == CreateProducts:已迁移(0.0019s)============================================
应该版本号(在本例中为 20090724013528)是否出现在迁移名称之前?
rake 0.8.7, rails/activerecord 2.3.3
Output from rake db:migrate:
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0017s
== CreateProducts: migrated (0.0019s) ========================================
Shouldn't the version number, in this case 20090724013528, appear before the migration name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我记不清 100%,但我认为当他们将迁移切换到 UTC 时间戳时,他们删除了输出中的数字。
但是,您可以使用以下命令检查数据库的当前版本:
I can't remember 100% but I think they removed the number in that output when they switch migrations over to the UTC timestamps.
You can however check the current version of your DB using:
正如 paulsnotes 所指出的,时间戳代表版本号。 如果您确实想切换回顺序编号,可以在environment.rb 中设置一个标志。
As pointed out by paulsnotes, the timestamp represents the version number. If you really want to switch back to sequential numbers, you can set a flag in environment.rb.