[RUBY] [Rails MySQL] How to reset DB on heroku

Contents

When I tried to reset the DB of the app on heroku created by Rails, I did `` `heroku run rake db: reset```, but an error occurred and I could not reset it.

Work done

In the error statement displayed in the terminal, it was written as follows.

rake aborted!
ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.
If you are sure you want to continue, run the same command with the environment variable:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1

When translated,

If you want to continue, run the same command with the environment variables.
DISABLE_DATABASE_ENVIRONMENT_CHECK = 1```
 Because it is written

heroku run rake db:reset DISABLE_DATABASE_ENVIRONMENT_CHECK=1

 I wrote it like this and executed it again, and the DB was successfully reset.


Recommended Posts

[Rails MySQL] How to reset DB on heroku
[Ruby On Rails] How to reset DB in Heroku
Note how to rollback Mysql deployed on Heroku
How to deploy on heroku
How to deploy jQuery on Rails
[rails] How to display db information
How to deploy Bootstrap on Rails
Rails on Tiles (how to write)
Deploy Rails on Docker to heroku
Rails DB PostgreSQL changed to MySQL
How to redo a deployment on Heroku
[Ruby on Rails] How to use CarrierWave
Deploy to heroku with Docker (Rails 6, MySQL)
How to publish an application on Heroku
How to use MySQL in Rails tutorial
Deploy to Heroku [Ruby on Rails] Beginner
[Ruby on Rails] How to use redirect_to
[Ruby on Rails] How to use kaminari
[Ruby on Rails] How to display error messages
[Docker] How to back up and restore the DB data of Rails application on docker-compose [MySQL]
How to write Rails
How to add / remove Ruby on Rails columns
Introducing New Relic to Rails apps on Heroku
How to save images on Heroku to S3 on AWS
How to uninstall Rails
Error deploying rails5 + Mysql to heroku with Docker-compose
How to install MySQL
[Ruby on Rails] How to install Bootstrap in Rails
[Ruby on Rails] How to use session method
How to post images on Heroku + CarrierWave + S3
How to make batch processing with Rails + Heroku configuration
[Ruby on Rails] How to write enum in Japanese
[Ruby on Rails] How to change the column name
How to connect to ClearDB from Sequel Pro on Heroku
Install MySQL 5.6 on CentOS6 [How to specify the version]
[Ruby on Rails] From MySQL construction to database change
(Ruby on Rails6) How to create models and tables
[rails] How to post images
[Rails] How to use enum
[Rails] How to install devise
[Rails] How to use enum
How to read rails routes
How to terminate rails server
How to write Rails validation
How to write Rails seed
[Rails] How to use validation
[Rails] How to disable turbolinks
[Rails] How to use authenticate_user!
[Rails] How to use "kaminari"
[Rails] How to implement scraping
[Rails] How to make seed
How to write Rails routing
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
[Rails] How to use Scope
[Ruby on rails + Mysql] Data migration procedure memo when switching from heroku to AWS
How to deploy a simple Java Servlet app on Heroku
How to specify db when creating an app with rails
How to display a graph in Ruby on Rails (LazyHighChart)
[Ruby on Rails] Column restrictions when saving to DB (4 representatives)
How to run React and Rails on the same server