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

Console commands do not respect dbname_suffix when replica configuration is used #1469

Closed
kschusternetformic opened this issue Feb 7, 2022 · 7 comments

Comments

@kschusternetformic
Copy link
Contributor

kschusternetformic commented Feb 7, 2022

When running tests, the dbname_suffix is being ignored in the test/doctrine.yaml when a replica is set up. I have tried setting this options in the replica section in the test/doctrine.yaml, tried to reset the replica in the test environment, all with no effect.

Main doctrine.yaml:

doctrine:
  dbal:
    default_connection: default
    connections:
      default:
        url: '%env(resolve:DATABASE_URL_WRITER)%'
        server_version: '13.4'
        driver: pdo_pgsql
        replicas:
          replica1:
            url: '%env(DATABASE_URL_READER)%'

test/doctrine.yaml:

doctrine:
    dbal:
        connections:
          default:
            # "TEST_TOKEN" is typically set by ParaTest
            dbname_suffix: '_test%env(default::TEST_TOKEN)%'
@dmaicher
Copy link
Contributor

dmaicher commented Feb 7, 2022

does this work?

doctrine:
    dbal:
        connections:
            default:
                dbname_suffix: '_test%env(default::TEST_TOKEN)%'
                replicas:
                    replica1:
                        dbname_suffix: '_test%env(default::TEST_TOKEN)%'

@kschusternetformic
Copy link
Contributor Author

Hi @dmaicher,

no unfortunately that's being ignored.

@dmaicher
Copy link
Contributor

dmaicher commented Feb 7, 2022

Then this looks like a bug to me. Do you want to look into fixing it @kschusternetformic ?

@kschusternetformic
Copy link
Contributor Author

Yeah, I will look into it.

@kschusternetformic
Copy link
Contributor Author

kschusternetformic commented Feb 8, 2022

This is a quick fix due to lack of deep knowledge of the project. I hope this at least outlines the problem if the MR itself is not applicable.
Merge Request: #1470

@kschusternetformic
Copy link
Contributor Author

@dmaicher We got it fixed and merged, waiting for release now. Thanks!

@ostrolucky ostrolucky added this to the 2.5.7 milestone Feb 28, 2022
@dmaicher
Copy link
Contributor

Thanks @kschusternetformic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants