doctrine / data-fixtures

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

Don't purge read-only marked table #405

Closed Superkooka closed 1 year ago

Superkooka commented 1 year ago

It makes no sense to purge tables marked as read-only

greg0ire commented 1 year ago

Thanks @Superkooka !

stof commented 1 year ago

This is wrong to me. Doctrine ORM's readOnly in metadata does not actually mean that the ORM only reads in it (yes, this naming is crappy). The ORM will happily insert or delete from that table if you use $em->persist() or $em->remove(). The only thing it will not do is updating objects that it has read from the DB.

In a sense, this is similar to readonly properties in PHP: you can still write to them once or unset them.

greg0ire commented 1 year ago

Let me revert this then.