LoginSignup
0
0

More than 1 year has passed since last update.

HerokuとローカルのDBの同期

Posted at

はじめに

herokuでデプロイする際、ローカルで作成済みのDB(今回はpostgresql)をそのままHerokuのDBに移行する方法

環境

・mac os
・postgresql

ローカルDB→Heroku

PGUSER=username PGPASSWORD=password heroku pg:pull DATABASE_URL dbname --app appname

既にHeroku上にDBが存在する場合、エラーが発生するので下記コマンドでdbをリセット後、改めて上記のコマンドを実行

 heroku pg:reset --app appname
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