Is there a rake task that shows the pending migrations in a rails app?
This works for rails 5.2
ActiveRecord::Base.connection.migration_context.needs_migration?
rake db:version
will accomplish this on Rails 2.
rake db:migrate:status
(Rails 3 to 5) or rails db:migrate:status
(Rails 5) will accomplish this. See this commit.
up
means the migration has been run. down
means the migration has not been run.
Try rake -h (help) and have a look at rake -n (= rake --dry-run). So probably something like rake -n db:migrate should get you what you want.