2

I am working with multiple Entity Managers and Connections in both DEV and PROD environements without any problem.

In TEST environement I tried to add another connection inside doctrine.yaml file like this:

enter image description here

But only the database related to default connection is created with command symfony console --env=test doctrine:database:create (I need both of them),

Should I follow the same configuration I did before with DEV environment to configure two entity managers or can I directly add two dbname_suffix under test bloc ?

Khribi Wessim
  • 287
  • 2
  • 12
  • sure it is in env-files? (`.env.local` and/or `.env.test` ) try to `composer dump-env test` to make all env-vars in `.env.local.php` – V-Light Aug 05 '22 at 11:12
  • Yes both Database URI are in env-files. I just need both database created with command `symfony console --env=test doctrine:database:create`, in my case the `default` one only was added – Khribi Wessim Aug 05 '22 at 13:09
  • [Please do not upload images of code/data/errors when asking a question.](//meta.stackoverflow.com/q/285551) – IMSoP Aug 09 '22 at 10:55

1 Answers1

1

You can use --connection attribute like:

symfony console --env=test doctrine:database:create --connection=microservice

Pavel A.
  • 326
  • 1
  • 3
  • 11