0

We've set our configuration file for doctrine migrations as the following:

doctrine_migrations:
    migrations_paths:
        'App\Migrations': "%kernel.project_dir%/src/Migrations"

Our migrations command all work, for example, doctrine:migrations:migrate works, doctrine:migrations:list will list all the migrations in our /src/Migrations folder. However, we cannot execute the doctrine:migrations:execute <versionNumber> command because it will give an error that it cannot find the migration file: "Migration class "20220329211652" was not found?"

Does doctrine:migrations:execute not work for custom migration paths configuration? When placing these migrations back in the default folder, it works.

sbkevin
  • 11
  • 1
  • 3
  • 1
    Putting the migrations in `App\Migrations` is [discouraged](https://github.com/symfony/recipes/blob/master/doctrine/doctrine-migrations-bundle/3.1/config/packages/doctrine_migrations.yaml) but maybe it's ok if you exclude them in `config/services.yaml`. Are you updating the namespace when moving the files? And IIRC, you should use the full classname: `bin/console d:m:m App\Migrations\Version20220329211652`. – msg Mar 30 '22 at 15:45

1 Answers1

1

It worked by using a fully qualified class name like:

bin/console doctrine:migrations:execute "App\Migrations\Version20220329211652"
sbkevin
  • 11
  • 1
  • 3