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

Make sure entities that are marked readOnly are excluded from purge #242

Closed
wants to merge 1 commit into from
Closed

Make sure entities that are marked readOnly are excluded from purge #242

wants to merge 1 commit into from

Conversation

dhaarbrink
Copy link

In my case this entity is implemented as a view, DELETE or TRUNCATE won't work.
Whatever the case, readOnly implies no changing the data.

@mikeSimonson
Copy link
Contributor

@dhaarbrink Well the issue here is that apparently the readonly entities were not implemented to represent views. Don't know how the view should be represented nor how they should be treated by the data-fixture.

The easiest is probably to put those readonly entities (views) on a different connection/entity manager.
So that they are not touched by purge at all.

@YaoOcelotl
Copy link
Contributor

I use the filter schema expression from the DBAL connection.
See Add ability to exclude tables from purge in ORM

# Doctrine Configuration
doctrine:
    dbal:
        schema_filter: ~^(?!view)~

@dhaarbrink
Copy link
Author

@YaoOcelotl thanks for the tip. Sadly it isn't released yet, but I did that myself now.
This was indeed what I needed, I will close this PR.

@dhaarbrink dhaarbrink closed this Aug 25, 2016
@mikeSimonson mikeSimonson added this to the 1.2.2 milestone Nov 9, 2016
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

Successfully merging this pull request may close these issues.

3 participants