Deprecate creation of empty namespaces#7186
Merged
morozov merged 1 commit intodoctrine:4.4.xfrom Oct 9, 2025
Merged
Conversation
derrabus
approved these changes
Oct 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a prerequisite for fixing #7184.
Currently, there are two ways of creating a namespace in the
Schema:At the same time, there is no way to drop a namespace from the
Schema:In
5.0.x, I will rework the internals of theSchemaclass such that tables and sequences will be indexed by their schema name (i.e. the namespace) and unqualified name. This way, listing the names of all namespaces in the schema will be as trivial as listing the top-level keys of this two-dimensional array.Retaining the possibility of adding namespaces manually would require additional maintenance of the namespaces within the schema, while the deprecation of this behavior will allow fixing the issue mentioned above.
Rejected alternatives
Adding the possibility of manually dropping the namespace from the schema doesn't look like a good options because:
Schema::toDropSql()doesn't drop the namespaces andAbstractPlatform::getAlterSchemaSQL()doesn't respectSchemaDiff::getDroppedNamespaces(), so even if the namespace exists, it will remain there even if it's dropped from the application-managed schema.