LoginSignup
0
0

More than 3 years have passed since last update.

Herokuデータベース内の行数が増えた時の対処(cloud9)

Last updated at Posted at 2021-04-12

※DBに会員データなどが保存されていない(テスト運用中など)場合の対処です。

Database disruption imminent, row limit exceeded for hobby-dev database

いきなりHrokuから【[warning] Database disruption imminent, row limit exceeded for hobby-dev database…】とメールがきました。
翻訳したところ、「データベースの中断が差し迫っています。hobby-devの行制限を超えています。」とのことです…
heroku pg:infoで中身を確認します。

=== DATABASE_URL
Plan:                  Hobby-dev
Status:                Available
Connections:           0/20
PG Version:            13.2
Created:               2021-03-17 01:49 UTC
Data Size:             10.5 MB
Tables:                10
Rows:                  10668/10000 (Above limits, access disruption imminent)
Fork/Follow:           Unsupported
Rollback:              Unsupported
Continuous Protection: Off
Add-on:                postgresql-curly-61190

すでに超えています…
まだテストデータを保存したりしたくらいなのに、なぜか…
調べてみると、データベース内の全件削除などをすると、行数がかさんでいくとの事でした。

解決策

メールにはHooby Basicプランに変更するよう書かれていましたが、まだ誰も使っていないのと、お金を掛けたくないので、データベースのリセットをしました。

ターミナルで以下を実行
heroku pg:reset DATABASE
To proceed, type…と出るので、herokuのアプリ名を入力し実行

・再度データベースを構築
heroku run rails db:migrate

・確認
heroku pg:info

=== DATABASE_URL
Plan:                  Hobby-dev
Status:                Available
Connections:           0/20
PG Version:            13.2
Created:               2021-03-17 01:49 UTC
Data Size:             8.6 MB
Tables:                10
Rows:                  17/10000 (In compliance)
Fork/Follow:           Unsupported
Rollback:              Unsupported
Continuous Protection: Off
Add-on:                postgresql-curly-61190

スカスカに戻りました(笑)

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