Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thexpand opened this issue Jun 28, 2020 · 2 comments
Open

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

thexpand opened this issue Jun 28, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@thexpand
Copy link

thexpand commented Jun 28, 2020

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')
        ),
    ]
);
@Ocramius
Copy link
Member

I thought the 'em' key would suffice: is this a BC break in the upstram library? Similar to #27, I think we need to cement these with runnable examples: unit tests will just not cut it long-term.

@Ocramius Ocramius added the bug Something isn't working label Jun 28, 2020
@thexpand
Copy link
Author

thexpand commented Jun 29, 2020

I don't think it's a BC break in the upstream library. Before I used the psr-container-doctrine implementation for the migrations, I had my own factory to create the configuration and I still needed this entry in the helper set, so I think it was always required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants