doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.78k stars 224 forks source link

OrmPurger in LoadDataFixturesDoctrineCommand ignores dbal schema_filter #303

Closed DangerLifter closed 5 years ago

DangerLifter commented 6 years ago

I have a view which is defined as readonly entity for query builders supporting. In dbal schema_filter there is "schema_filter: ~(?!_view)$~" which as I consider should exclude those tables from management. But running doctrine:fixtures:load still causes purging from those tables : The target table recent_product_history_view of the DELETE is not updatable

alcaeus commented 5 years ago

The purger operates on all classes for which the entity manager has metadata, so the schema filter is not going into effect here as the purger doesn't use the schema tool. However, the readonly flag doesn't mean that the table should be ignored; it only disables change tracking within ORM and marks the entity as immutable.

Last but not least, I'm moving this issue to the data-fixtures repository where the purger is located; if this is considered a valid bug it needs to be fixed there.

Ocramius commented 5 years ago

Closing here: schema management and fixture management are disjunct sets, and the option has nothing to do with loading/clearing fixtures.