doctrine / data-fixtures

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

Don't purge read-only marked table #405

Closed Superkooka closed 2 years ago

Superkooka commented 2 years ago

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

greg0ire commented 2 years ago

Thanks @Superkooka !

stof commented 2 years 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 2 years ago

Let me revert this then.