Note how to rollback Mysql deployed on Heroku

Introduction

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 スクリーンショット 2020-10-28 16.09.06.png


● Regeneration

Execute command

Database generation
$ heroku run rails db:create

Perform migration
$ heroku run rake db:migrate

reference

[Rails5] heroku db: from reset to migrate Rails 5 production doesn't allow rake db: drop, normally

Recommended Posts

Note how to rollback Mysql deployed on Heroku
[Rails MySQL] How to reset DB on heroku
How to deploy on heroku
How to check the database of apps deployed on Heroku
How to redo a deployment on Heroku
How to publish an application on Heroku
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku
How to install NVIDIA driver on Ubuntu 18.04 (Note)
How to install MySQL
How to post images on Heroku + CarrierWave + S3
How to connect to ClearDB from Sequel Pro on Heroku
[Ruby On Rails] How to reset DB in Heroku
Install MySQL 5.6 on CentOS6 [How to specify the version]
[Note] How to write Dockerfile/docker-compose.yml
How to rollback migration files
How to deploy a simple Java Servlet app on Heroku
How to deploy jQuery on Rails
[Rails] How to use devise (Note)
How to "hollow" View on Android
[Note] Update to production environment [heroku]
[Java] How to update Java on Windows
How to install ImageMagick on Windows 10
How to use Ruby on Rails
How to deploy Bootstrap on Rails
How to run JavaFX on Docker
How to use Bio-Formats on Ubuntu 20.04
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
How to connect Heroku and Sequel
How to install MariaDB 10.4 on CentOS 8
Rails on Tiles (how to write)
[Note] Update to production environment (heroku)
Steps to install MySQL 8 on CentOS 8
How to install WildFly on Ubuntu 18.04
Deploy Rails on Docker to heroku
How to build vim on Ubuntu 20.04
How to check Java installed on Mac
A memorandum on how to use Eclipse
How to use Apache Derby on Eclipse
[Ruby on Rails] How to use CarrierWave
I want to display background-ground-image on heroku.
How to detect microphone conflicts on Android
Deploy to heroku with Docker (Rails 6, MySQL)
How to install Eclipse (Photon) on Mac
[Note] How to get started with Rspec
How to install production Metabase on Ubuntu
How to switch Java versions on Mac
How to install beta php8.0 on CentOS8
How to change the timezone on Ubuntu
How to implement gem "summer note" in wysiwyg editor in Ruby on Rails
How to use Java Scanner class (Note)
[Ruby on Rails] How to use redirect_to
[Note] How to use Rails 6 Devise + cancancan
[Ruby on Rails] How to use kaminari
How to install kafkacat on Amazon Linux2
Ruby: CSV :: How to use Table Note
Note: [Docker] How to start and stop
How to send push notifications on AWS
[Ruby on Rails] How to display error messages
How to deploy a container on AWS Lambda
How to configure ubuntu to be used on GCP
How to add / remove Ruby on Rails columns