I've added heroku postgres addon.
The DATABASE_URL is something like postgres://xxxxxxxxx:[email protected]:5432/ddo2ahvosfggq
I want the database name to be like my_app_database. I want to rename ddo2ahvosfggq to my_app_database.
How can I do that?
Can I use ALTER DATABASE? http://www.postgresql.org/docs/9.1/static/sql-alterdatabase.html
There is already a question in StackOverflow How to rename database in Heroku?
But the answers is to rename the app. I don't know how renaming app will work?
If my_app is the name of my heroku app. Will the below DATABASE_URL work?
postgres://xxxxxxxxx:[email protected]:5432/my_app
ALTER DATABASE current_name RENAME TO my_app_databaseDATABASE_URLdatabase.ymlfor production. It automatically generate required things. You can remove production section from yourdatabase.ymland push to heroku. Still heroku will work fine.