Create and deploy an app with RubyOnRails. Make a note of the beta date reset after running the migration file on Heroku.
● Check environment variables from error messages
Execute command
$ heroku run rake db:migrate:reset!
Error screen
● Add the confirmed environment variable DISABLE_DATABASE_ENVIRONMENT_CHECK = 1 and drop the database.
Execute command
$ RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop
After execution
● Regeneration
Execute command
Database generation
$ heroku run rails db:create
Perform migration
$ heroku run rake db:migrate
[Rails5] heroku db: from reset to migrate Rails 5 production doesn't allow rake db: drop, normally
Recommended Posts