I need to assess the database schema of the Postgres instance running on Heroku. Without luck, I have tried the following methods:
heroku run -a my_app_name 'pg_dump -s DATABASE_URL' > output.sql
where DATABASE_URL would be the whole string out of
heroku config:get DATABASE_URL -a my_app_name
This is the closest I could get, as the command runs but the output is left empty. For this I added the flag -s for pg_dump to only get the schema and no data.
I have also tried following this answer but couldn't use it to get the schema.
heroku run -a ...one should work fine, worked for me just now. Are you sure you're using the rightDATABASE_URL?DATABASE_URLfrom the heroku -> my app -> resources -> view database credentials then copiedURIif that helps anybody else.