Just looking at my database.yml file for my Rails 4 app and noticed there isn't any setting for the production database - only the test and development ones.
I don't actually have any issues but wanted to avoid other potential issues by posting this question.
Locally I use a PG database and I host my app on Heroku using a PG db too.
Should I have some settings in the yml for the production database file as I'm really not sure?
Whatever you place in database.yml will be overwritten by Heroku during production deployment, as it uses its own application configuration to effectively write a new one.
https://devcenter.heroku.com/articles/ruby-support#build-behavior
Unless you need to deploy the database.yml to other environments, you can include it in gitignore
The above answers are no longer valid for Rails 4.x on Heroku. Heroku no longer overwrites your database.yml. You need the following entry in your config/database.yml file:
production:
url: <%= ENV['DATABASE_URL'] %>
If you host your application on Heroku and use a Heroku Postgres DB you don't need a production entry in your database.yml.
Heroku will replace your database.yml entirely with one that uses the DATABASE_URL from heroku:config.
So no, you don't need a production entry in your database.yml for Heroku-hosted apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With