我正在尝试在 heroku 上调试我的应用程序,但似乎一个或多个迁移没有运行。在不手动完成每个迁移的情况下,我试图找出哪个迁移是最后运行的迁移。
环境:rails、postgresql
最佳答案
来自终端:
heroku pg:psql --app app_name db_name
select * from schema_migrations;
寻找最后一个条目
另一种方式...从终端
heroku run console --app app_name
class SchemaMigration<ActiveRecord::Base
end
然后就写
SchemaMigration.last
关于ruby-on-rails - 如何获取在 heroku 中运行的最后一次迁移的数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30228150/