Skip to content

Doctrine Migrations - Missing configuration in cli-config.php #26

@thexpand

Description

@thexpand

The current documentation suggests the following configuration:

return new HelperSet(
    [
        'em' => new EntityManagerHelper(
            $container->get('doctrine.entity_manager.orm_default')
        ),
    ]
);

However, when I try to run php vendor/bin/doctrine-migrations migrations:status, it says that I have to provide a configuration for the database. The exact error is the following: You have to specify a --db-configuration file or pass a Database Connection as a dependency to the Migrations.. Shouldn't we actually make it as follows?

/** @var EntityManagerInterface $entityManager */
$entityManager = $container->get('doctrine.entity_manager.orm_default');

return new HelperSet(
    [
        'em'            => new EntityManagerHelper(
            $entityManager
        ),
        'configuration' => new ConfigurationHelper(
            $entityManager->getConnection(),
            $container->get('doctrine.migrations.orm_default')
        ),
    ]
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions