Ruby on Rails - running migrations with different environments in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
Run migrations in the test environment, run in shell command:
rake db:migrate RAILS_ENV=test
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
Starting in Rails 5.0, we can use rails instead of rake:
rails db:migrate RAILS_ENV=test