title: symfony doctrine migrations with multiple entity managers
body: <p>I'm trying to make SaaS application and for this purpose created multiple entity managers and corresponding connections by following <a href="https://symfony.com/doc/current/doctrine/multiple_entity_managers.html" rel="nofollow noreferrer">official documentation</a> but running <code>php bin/console doctrine:migrations:diff --em=customer</code> command results in exception <code>The &quot;--em&quot; option does not exist.</code>. I know that i can change <code>doctrine_migrations.yaml</code> parameter called <code>em</code> but that`s not a solution considering that number of entity managers can grow. Is there any workaround to go with?</p>
  <p>doctrine.yml:</p>
  <pre><code>doctrine:
      dbal:
          default_connection: default
          connections:
              default:
                  url: '%env(resolve:DATABASE_URL)%'
                  driver: 'pdo_mysql'
                  server_version: '5.7'
                  charset: utf8mb4
              tenant:
                  url: '%env(resolve:TENANT_DATABASE_URL)%'
                  driver: 'pdo_mysql'
                  server_version: '5.7'
                  charset: utf8mb4
                  wrapper_class: App\Service\Config\Database\Connection
  
      orm:
          auto_generate_proxy_classes: true
  
          default_entity_manager: default
          entity_managers:
              default:
                  auto_mapping: false
                  naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                  mappings:
                      Shared:
                          mapping: true
                          is_bundle: false
                          type: annotation
                          dir: '%kernel.project_dir%/src/Entity/Shared'
                          prefix: 'App\Entity\Shared'
                          alias: Shared
  
              tenant:
                  connection: tenant
                  auto_mapping: false
                  naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                  mappings:
                      Tenant:
                          mapping: true
                          is_bundle: false
                          type: annotation
                          dir: '%kernel.project_dir%/src/Entity/Tenant'
                          prefix: 'App\Entity\Tenant'
                          alias: Tenant
  </code></pre>
  <p><code>App\Service\Config\Database\Connection</code> class is just a wrapper that can change connection's parameters on fly.</p>