Kuniharu Aramaki
Kuniharu Aramaki

Reputation: 371

Resetting database on heroku

Now I am trying to reset database on heroku but got stuck.

I know I should do "heroku pg:reset Database URL but I don't know exactly what the databese url is.

I did "heroku config". So I got some strings. And tried

heroku pg:reset postgres://ffsqtmlnxntfvl:ajqGTMGEmT7U1S6sVdi7-bb7Cm@ec2-107-20-245-109.compute-1.amazonaws.com:5432/dc2kahsue8hn20. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_AQUA_URL

My command,however,always returns this to me.

Unknown database: postgres://xxxxxxxxx:[email protected]:xxxx/xxxxxxxxxxxxxx. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_AQUA_URL

What should I do? Could you give me some advice?

Upvotes: 0

Views: 235

Answers (2)

DeeBee
DeeBee

Reputation: 175

I know this question is old, but as I've just been through this, here is what I did:

  1. heroku pg:reset HEROKU_POSTGRESQL_HEROKUCOLOR_URL --confirm {app_name}
  2. heroku run rake db:schema:load
  3. heroku run rake db:migrate
  4. heroku run rake db:seed

As per: Heroku rake db:migrate does not create tables (Rails 5)

Upvotes: 0

fivedigit
fivedigit

Reputation: 18672

You should use:

heroku pg:reset HEROKU_POSTGRESQL_AQUA

Upvotes: 2

Related Questions