Skip to content
Advertisement

symfony doctrine migrations with multiple entity managers

I’m trying to make SaaS application and for this purpose created multiple entity managers and corresponding connections by following official documentation but running php bin/console doctrine:migrations:diff --em=customer command results in exception The "--em" option does not exist.. I know that i can change doctrine_migrations.yaml parameter called em but that`s not a solution considering that number of entity managers can grow. Is there any workaround to go with?

doctrine.yml:

JavaScript

AppServiceConfigDatabaseConnection class is just a wrapper that can change connection’s parameters on fly.

Advertisement

Answer

So far answer is: docs are outdated, doctrine/doctrine-migrations-bundle v3.1 will probably solve it, but it relies on doctrine/migrations library to release v3.1 (as mentioned in issue), and so far only solution is this workaround with command wrappers but it requires tweaks with configuration (YamlFile in article expects doctrine style config and not symfony’s)

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement