It was used while migration the production server and since this one and
production configs are almost exact copies (just rails_env differs) it's
no longer needed.
And this brings simplicity back to this repo.
The most noticeable change is the removal of `url` from production's
database config as DATABASE_URL got removed in
https://github.com/coopdevs/timeoverflow-provisioning/pull/21 two years
ago and it's true in production:
```
timeoverflow@timeoverflow-production:~$ env | grep DATABASE
DATABASE_NAME=xxx
DATABASE_USER=xxx
DATABASE_PASSWORD=xxx
```
We used to connect to it through the PostgreSQL URL but that ENV var is
no longer present in the server and we have `DATABASE_NAME` instead.
That's what we already used successfully with the `next` environment.
This is required to deploy using the `production` environment or the app
won't be able to connect to the DB.
This is the upgraded server we are setting up to host the app. Time to
deploy and start testing! 🎉
The Capistrano environment is tightly coupled with Rails environments so
we need to add a new one called `next`.
One can set the DATABASE_URL variable, which will set up the whole
connection, or use one or more of:
- DATABASE_ADAPTER
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_NAME
- DATABASE_USER
- DATABASE_PASSWORD
Each of them will just override a specific entry of the default
configuration, which is under the `"defaults"` key.
In a dev machine, one could probably just set DATABASE_USER and
DATABASE_PASSWORD. In a virtual server, the easiest way is to provide
DATABASE_URL. In heroku and similar providers, this file will be
overwritten.