5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

<備忘録>Herokuのdbを削除したい

Last updated at Posted at 2022-04-01

heroku上のデータベース(pstgrsql)を削除して作り直したい

$ heroku run rails db:reset
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:

                                          .
                                          .
                                          .
                                          .

どうやら、production環境のデータベースは誤って
消せないような仕組みらしい

ではどうするか、

下記のコマンドで消せました。

$ heroku pg:reset -a <アプリ名>

以上

Heroku上のデータベースの削除にしかたでした。

再立ち上げを忘れずに!

$ heroku run rails db:migrate

参考文献

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?