0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Supabase】Prisma Migration エラー発生時の対処方法

Posted at

開発時にPrismaのマイグレーションを実行したところ、このようなエラーが発生しました。

Error: P1001: Can't reach database server at `aws-0-ap-northeast-1.pooler.supabase.com`:`5432'

原因

supabaseは無料プランの場合1週間以上未使用となった場合に一時停止となるようです。
メールで通知は来てましたが、スルーしていました、、、。

スクリーンショット 2024-04-06 20.38.14.png

解消方法

supabaseにログインを行い、復旧を行うことで解除できました。
CLIで実行環境を構築している方は少し手順が違うかもしれません。

  • supabaseのホーム画面でRestore Projectをクリック

スクリーンショット 2024-04-06 20.09.45.png

  • 復旧中

スクリーンショット 2024-04-06 20.09.56.png

  • 復旧完了

スクリーンショット 2024-04-06 20.22.13.png

開発初期でデータは入れていなかったため、1分かからず復旧は完了しました。

この状態で再度マイグレーションを実行すると、、、

he following migration(s) have been created and applied from new schema changes:

migrations/
  └─ *****/
    └─ migration.sql

Your database is now in sync with your schema.

✔ Generated Prisma Client (v5.11.0) to ./node_modules/@prisma/client in 569ms

無事マイグレーションできました!

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?