如何知道在Rails中执行的最新迁移

时间:2015-01-16 10:19:25

标签: ruby-on-rails ruby-on-rails-4 rake rake-task

使用rake db:migrate:status我可以显示迁移的状态,但显示最新执行的方式是什么?

1 个答案:

答案 0 :(得分:1)

此处已在Stack Overflow上回答:https://stackoverflow.com/a/8847126/4461194

    1.9.3-p551 :001 > ActiveRecord::Migrator.current_version
   (0.6ms)  SELECT "schema_migrations"."version" FROM "schema_migrations"
 => 20150114073202