How to configure new Doctrine 3.0

Viewed 1091

I have an error with Doctrine 3.0:

In ArrayNode.php line 320:
                                                                                                                                                                                                 
  Unrecognized option "migrations_paths" under "doctrine_migrations". Available options are "all_or_nothing", "column_length", "column_name", "custom_template", "dir_name", "executed_at_colum  
  n_name", "name", "namespace", "organize_migrations", "table_name".

I checked the upgrade on GitHub but still not working

My actual doctrine_migrations.yaml*

doctrine_migrations:
    migrations_paths:
        # namespace is arbitrary but should be different from App\Migrations
        # as migrations classes should NOT be autoloaded
        'DoctrineMigrations': '%kernel.project_dir%/migrations'

Thanks for your hels

2 Answers

If you have doctrine migrations ^2.0 and updated to ^3.0 correct config will be:


doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'
    storage:
        table_storage:
            table_name: 'migration_versions'
            version_column_name: 'version'
            version_column_length: 255
            executed_at_column_name: 'executed_at'
            execution_time_column_name: 'execution_time'

Change config and then run command to sync metadata:

 bin/console doctrine:migrations:sync-metadata-storage

I solved my problem doing

composer update

Related