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 - purging always all databases #302

Closed olechafm closed 5 years ago

olechafm commented 6 years ago

By default OrmPurger in LoadDataFixturesDoctrineCommand removes data from all databases. There should be an option to purge data only from those that have Fixtures defined (loaded) and/or a param to pass excluded value for OrmPurger constructor that would allow to exclude some tables from purging (second param of constructor @param string[] $excluded array of table/view names to be excleded from purge)

usecase: any configuration tables, any tables where data shouldn't be changed, any tables that have data loaded from other source than fixture

Ocramius commented 5 years ago

Purging is based on metadata, not databases: the purger just clears everything as per reference implementation.

Same as in https://github.com/doctrine/data-fixtures/issues/301, marking this as won't fix, since you can implement your own purger from the interface.