Question

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:xxxxxxxxxxxxxxx@xxx-xxx-xx-xxx-xxx.compute-1.xxxxxxx.com:xxxx/xxxxxxxxxxxxxx. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_AQUA_URL

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

Was it helpful?

Solution

You should use:

heroku pg:reset HEROKU_POSTGRESQL_AQUA

OTHER TIPS

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top