Heroku rotates the credentials on Heroku Postgres. How can I prevent this issue in production apps?
CodePudding user response:
How can I prevent this issue in production apps?
The value of your app’s
DATABASE_URL
config var can change at any time. Do not rely on this value either inside or outside your Heroku app.
I'm not sure why you think this would be different for production apps. Maintenance of the underlying service is even more important in production than in development or staging.
How to know when Heroku rotates my Heroku Postgres credentials?
You don't need to know when this happens as the DATABASE_URL
environment variable will automatically be updated accordingly. Always use that variable to connect and you'll be fine.