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

[Bug]: Not configuring a schema manager factory is deprecated. Use %s which is going to be the default in DBAL 4. #318

Open
KoNekoD opened this issue Jul 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@KoNekoD
Copy link

KoNekoD commented Jul 4, 2024

Preconditions

  protected function createDatabaseIfNotExists(): void
    {
        $params = $this->connection->getParams();

        // doctrine-bundle >= 2.2
        if (isset($params['primary'])) {
            $params = $params['primary'];
        }
        // doctrine-bundle < 2.2
        elseif (isset($params['master'])) {
            $params = $params['master'];
        }
        $dbName = $params['dbname'] ?? '';

        unset($params['dbname'], $params['url']);

        // Unset url to avoid issue:
        // “An exception occurred in driver: SQLSTATE[HY000] [1049] Unknown database 'test'”

        $tmpConnection = DriverManager::getConnection($params, <- here needed to inject configuration with defined schema manager);

Steps to reproduce

Just start use library

Expected result

No deprecations

Actual result

Has deprecations

@KoNekoD KoNekoD added the bug Something isn't working label Jul 4, 2024
@alexislefebvre
Copy link
Collaborator

alexislefebvre commented Jul 15, 2024

Thanks for the report, what is %s in this context? Do you have more information about this deprecation?

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