Add ActiveRecord::Tasks::DatabaseTasks.migrate

This extracts the logic that was embedded in a Rake task into a static
method.
Bonus: the first test for `rake db:migrate`
Merge pull request #16350 from JackDanger/test-rake-db-migrate-task

Add ActiveRecord::Tasks::DatabaseTasks.migrate