Symfony 5.1.2 Unrecognized options “dir_name, namespace” under “doctrine_migrations”.

At my recent update from Symfony 5.1.0 to Symfony 5.1.2 I got surprised by this error message:

Unrecognized options "dir_name, namespace" under "doctrine_migrations". Available options are "all_or_nothing", "check_database_platform", "connection", "custom_template", "em", "migrations", "migrations_paths", "name", "organize_migrations", "services", "storage"

And it took me quite some time to find out what went wrong…

… since one should assume that a clean bugfix-update won’t produce such an error.

Well, the problem was, that I still hat doctrine installed as symfony/orm-pack, and within this pack the actual doctrine-modules are enclosed. And when I then executed

composer update symfony/* --with-all-dependencies

of course the symfony/orm-pack (and the enclosed doctrine-modules as well) was updated to the newest version… The problem with that is, that in the meantime doctrine 3.0 has been published and this version does not seem to be as compatible with the doctrine 2.x versions as it would be necessary to be to simply update it. Actually, you might expect such incompatabilities on a major version change.

The Solution

Via discussions on github with various suggested solutions – which all didn’t work for me – I came across this article Symfony 4: Unpack the Packs which – among other things – urged to “unpack” the originally oh so comfortable installed symfony/…-packs and by doing so replacing the symfony/…-pack with the original modules in the composer.json list.
This prevents any unintended updates of these modules, i.e. here the doctrine-modules

And, voila: a succeeding

composer update symfony/* --with-all-dependencies

updated everything smoothly.

Dieser Beitrag ist auch verf├╝gbar auf: German

Leave a Comment