72
72

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 5 years have passed since last update.

heroku上のDBをリセットする

Last updated at Posted at 2017-02-04

heroku上でのDB操作

herokuで

rake db:reset
rake db:migrate:reset

のようにデータベースを操作する場合、

Running rake db:reset on ⬢ hidden-mountain-82613... up, run.9384 (Free)
FATAL:  permission denied for database "postgres"
DETAIL:  User does not have CONNECT privilege.
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5

となり、Permission deniedされてしまう。

そこで、herokuでDBを操作する場合は

heroku pg:reset DATABASE_URL

を行う。

その後

heroku run rake db:migrate
heroku run rake db:seed

などを行う。

72
72
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
72
72

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?