Question: I recently started working with Symfony 4. 

While developing I like to have two different environments: one for dev (surfing the site with some fake data that we have on fixtures) and one for testing where I execute behat tests that reset the database on each test. 

In previous versions of symfony I just had two different databases: mysite\_dev and mysite\_test and two parameters files (parameters\_dev.yml and parameters\_test.yml) with the proper database configuration.

But with Symfony 4 and the .env configuration file I don't see the way of doing this. I don't see any way of having two sets of ddbb params and be able to run php bin/console doctrine:schema:update --env=test or php bin/console doctrine:schema:update --env=dev.

Any ideas? thanks!

Answer: 
how about using different url variables in your config?

```
# config/packages/dev/doctrine.yaml
doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL_DEV)%'

# config/packages/test/doctrine.yaml
doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL_TEST)%'

```

also consider this comment from the default config file

```
parameters:
    # Adds a fallback DATABASE_URL if the env var is not set.
    # This allows you to run cache:warmup even if your
    # environment variables are not available yet.
    # You should not need to change this value.
    env(DATABASE_URL): ''

```
It's quite easy: your commands can still reference an environment with `--env` and everytime you need to switch from one environment to other you have basically two choices:

* Change manually the `.env` file
* Create a second "vhost" (or equivalent) where you can store all variables you would normally place into `.env` as described [here](https://symfony.com/doc/current/configuration/external_parameters.html#configuring-environment-variables-in-production)