doctrine/orm

Schema exclude annotation

Open

#8,195 opened on Jun 25, 2020

View on GitHub
 (9 comments) (0 reactions) (0 assignees)PHP (2,539 forks)batch import
HacktoberfestNew Feature

Repository metrics

Stars
 (10,176 stars)
PR merge metrics
 (Avg merge 29d 6h) (13 merged PRs in 30d)

Description

Feature Request

Q A
New Feature yes
RFC yes
BC Break no

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.

Contributor guide