LoginSignup
0
0

More than 3 years have passed since last update.

rails db:migrate:resetでDISABLE_DATABASE_ENVIRONMENT_CHECK=1と出た時

Posted at

エラー内容

開発でrails db:migrate:resetを本番環境でした際に、

$ rails db:migrate:reset RAILS_ENV=production

Creating network "child_app_default" with the default driver
rails 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

とエラーが出た。

対処法

DISABLE_DATABASE_ENVIRONMENT_CHECK=1をつけてあげるだけ!

$ rails db:migrate:reset RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1

これで実行できます!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0