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

[1.11] schema_filter configuration no longer works #971

Closed
enumag opened this issue May 15, 2019 · 10 comments
Closed

[1.11] schema_filter configuration no longer works #971

enumag opened this issue May 15, 2019 · 10 comments
Assignees

Comments

@enumag
Copy link

enumag commented May 15, 2019

We have some Doctrine entities which are read only because they are mapped to views instead of regular tables. To prevent the tables from being generated by doctrine migrations we're using a configuration like this:

doctrine:
    dbal:
        schema_filter: ~^(?!foo_view|bar_view)~

After updating to DoctrineBundle 1.11.1 this no longer works and doctrine/migrations is trying to generate normal tables for these entities.

@alcaeus
Copy link
Member

alcaeus commented May 16, 2019

Could you please let me know what version of doctrine/dbal you have installed? You can find out by running composer show doctrine/dbal. This might be caused by #935 not correctly applying a regular expression filter to the new chain. #966 added a missing compiler pass registration, but since you mentioned you're using DoctrineBundle 1.11.1 this shouldn't be the issue.

There's also a test to make sure the filter is registered correctly when the compiler pass is registered, so I'm not quite sure where the issue is coming from:

public function testDbalSchemaFilterNewConfig()

@keksa
Copy link

keksa commented May 16, 2019

Hello @alcaeus, we have the following doctrine packages installed:

doctrine/annotations - v1.6.1
doctrine/cache - v1.8.0
doctrine/collections - v1.6.1
doctrine/common - v2.10.0
doctrine/data-fixtures - v1.3.1
doctrine/dbal - v2.9.2
doctrine/doctrine-bundle - 1.11.1
doctrine/doctrine-cache-bundle - 1.3.5
doctrine/doctrine-migrations-bundle - v1.3.2
doctrine/event-manager - v1.0.0
doctrine/inflector - v1.3.0
doctrine/instantiator - 1.2.0
doctrine/lexer - v1.0.1
doctrine/migrations - v1.8.1
doctrine/orm - v2.6.3
doctrine/persistence - 1.1.1
doctrine/reflection - v1.0.0
doctrine/doctrine-fixtures-bundle - v2.4.1

@alcaeus
Copy link
Member

alcaeus commented May 16, 2019

Hmm, that’s odd. Any chance you could debug this to see what’s going on? I currently don’t have a bundle setup.

@enumag
Copy link
Author

enumag commented May 16, 2019

Can you give us some tips where to look? I've no idea where the schema_filter is supposed to be used.

@alcaeus
Copy link
Member

alcaeus commented May 16, 2019

You should see a doctrine.dbal.<connection-name>_regex_schema_filter service that is tagged with the doctrine.dbal.schema_filter tag. There should also be a call to setSchemaAssetsFilter on the doctrine.dbal.<connection-name>_connection.configuration service with an argument that contains a SchemaAssetsFilterManager instance.

@enumag
Copy link
Author

enumag commented May 17, 2019

setSchemaAssetsFilter is properly called with the correct filter. However the RegexSchemaAssetFilter is never even asked about the tables we want to ignore. Any ideas how that could have happened?

@enumag
Copy link
Author

enumag commented May 17, 2019

Ok I checked back on the 1.10 version and the schema filter is never called there for the views we want to ignore either. Which means schema filter was not the thing that made them ignored. Something else must be broken.

@enumag
Copy link
Author

enumag commented May 17, 2019

Hmm no it is the schema filter after all. When I remove the views from the schema filter the tables are generated by the next migration. However it's not this line that causes it. Which means the schema filter must be used somewhere else as well in the older version but the usage got removed in 1.11.

@enumag
Copy link
Author

enumag commented May 17, 2019

I think I identified the problem. See the PR in doctrine/migrations.

@alcaeus
Copy link
Member

alcaeus commented Jul 9, 2019

Closing as this was an issue in doctrine/migrations.

@alcaeus alcaeus closed this as completed Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants