mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Schema tool doesn't play well with metadata caching #5798
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @martixy on GitHub (Dec 11, 2017).
Originally assigned to: @lcobucci on GitHub.
I was making changes to my model and had created a new entity, and was using the schema tool to dump the raw SQL.
I spotted a small mistake in my definition and after fixing it and dumping again, the change wasn't reflected.
Eventually I discovered that when you have metadata caching, only the first version of any new entity is recognised. Thereafter, no matter what changes you make to your entity, the schema tool not reflect those, since it has now cached the first version, and that's all it knows.
Given the function of this tool, would it not be better to force it to bypass caching altogether?
@Ocramius commented on GitHub (Dec 11, 2017):
No - the schema tool just receives metadata: whether that requires cache
invalidation or not is to be decided on a case-by-case basis.
It is a generic tool and it should stay as such.
On 11 Dec 2017 19:00, "Martin Ninov" notifications@github.com wrote:
@martixy commented on GitHub (Dec 11, 2017):
For me, this seems an easy pit to fall into. While I wouldn't know the best solution to this, I believe it's a good idea to address this somehow - be it in code or documentation.
@Ocramius commented on GitHub (Dec 15, 2017):
Documentation patches are indeed welcome: just needed to clarify the design
decisions first 👍
On 11 Dec 2017 19:12, "Martin Ninov" notifications@github.com wrote:
@lcobucci commented on GitHub (Dec 17, 2017):
I'll close this issue as per @Ocramius comments.
@martixy please do send a PR improving the docs!