-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema exclude annotation #8195
Comments
It would be better if we have a list of classes in Instead of a class list, maybe even better to have a callable like |
I guess a list of classes would do, callbacks for something like this seem like an archaic method of processing this. With regard to cache size, the number of entities that are likely to implement my suggested annotation in a project would be very minimal. I honestly don't care how it is done, I would prefer it to be via configuration rather than a callback though. I would just like to be able to use migrations. |
@ianef alright, from my POV if you build it with a map of entities to skip, I am going to merge it for 2.8 |
@beberlei Can you point me at a Symfony dev repo that I can easily pull my fork of doctrine/orm 2.8 into, trying to shoehorn it into a standard framework builds seems a tad tricky, the pinch point seems to be the doctrine/doctrine-bundle which is restricting packages and preventing doctrine/persistence 2.0. |
@ianef you should implement it with a clean checkout of doctrine/orm and by adding a test to the |
I've created PR #8202 for this, hope it looks OK to you. Hmmm, not sure where all those other commits came from, there were 2 of mine! I guess somethings gone wrong here. |
You might have started with master branch instead of 2.8 |
Well I thought I checked out 2.8.x but it says 3.0.x in composer.json, deep joy! I’ll delete the PR and do it again, it’s not a big change. |
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]>
Co-authored-by: Simon Podlipsky <[email protected]> Co-authored-by: Iab Foulds <[email protected]>
* 2.11.x: Deprecate Setup::registerAutoloadDirectory() (doctrine#9249) PHPCS 3.6.2, Psalm 4.15.0 (doctrine#9247) Add SchemaIgnoreClasses property for doctrine#8195. (doctrine#9202) Remove fallbacks for old doctrine/annotations version (doctrine#9235) Update docs/en/reference/events.rst Added psalm param to abstract addFilterConstraint (doctrine#9229) Merge pull request doctrine#9210 from alexander-schranz/patch-2 Fix typo assumptio--> assumption Update events.rst Completing links to `EventArgs` classes in overview table Using `const` for `type` [Documentation] Events Overview Table: Adding "Passed Argument" column
Feature Request
When using migrations or schema operations, there are facilities to ignore tables via schema_filter setting, see Ignoring Custom Tables.
However there are many circumstances where entities should not be included for consideration in the schema. For example entities based on views, multiple entities for the same table or view for different sections of a project or serialisation requirements. Relying on excluding items just by the table name does not work for a lot of real world situations.
Currently there is no way to prevent a normal entity from being excluded in the schema list, this can cause schema failures and the inability to use the migration or schema tools in Doctrine.
I would like to propose adding a @SchemaExclude annotation which could be tested for in the SchemaTool::procesingNotRequired method and prevent the entity table from being added to the schema table list.
Many thanks.
Ian.
The text was updated successfully, but these errors were encountered: