Here’s the story, my heroku site was originally using the 5mb shared postgres db with no problems. I had a valid SHARED_DATABASE_URL and no DATABASE_URL
Then I added a config var by doing
heroku config:add DATABASE_URL=non_existing_database_just_for_fun
Just to see if it would switch from the shared db to this new one I just set. It did just that, and promptly crashed my app as expected since no valid database was found.
Then I did heroku config:remove DATABASE_URL hoping to get my site back to normal. But now it keeps crashing and never succeeds in starting up. If I do a heroku config I see that I still have a valid SHARED_DATABASE_URL and no DATABASE_URL but the site still wont work.
I did get it working by setting up DATABASE_URL to match SHARED_DATABASE_URL but I’d like to get it back to how things were originally, the site working without needing DATABASE_URL. Any ideas no how I can get things back to the way they were short of having to reinstall my site?
DATABASE_URLis the key that Heroku expect you to use for your database connectivity. They will not touch this value unless you ask them to (aside from initial setup).The
SHARED_DATABASE_URLis the URL of the shared database that they have provided to you.By default, Heroku set your
DATABASE_URLto match yourSHARED_DATABASE_URL.I’m not entirely sure why would would want your application to not have a
DATABASE_URL, as that’s what’s used. If you look at the bottom of this, you can see what they do with yourconfig/database.ymland how it affects your application.