ActiveRecord migrations:
*Running migrations in different environments
To run migrations in the test environment, run this shell command:
rake db:migrate RAILS_ENV=test
Starting in Rails 5.0, you can use rails instead of rake:
rails db:migrate RAILS_ENV=test