Skip to content

Accept OptionallyQualifiedName in TableEditor::setName()#6784

Merged
morozov merged 1 commit intodoctrine:4.3.xfrom
morozov:table-editor-set-name
Feb 17, 2025
Merged

Accept OptionallyQualifiedName in TableEditor::setName()#6784
morozov merged 1 commit intodoctrine:4.3.xfrom
morozov:table-editor-set-name

Conversation

@morozov
Copy link
Member

@morozov morozov commented Feb 16, 2025

Background

TableEditor was the first object editor introduced (#6660). Later, it was followed by UniqueConstraintEditor (#6685) and ForeignKeyConstraintEditor (#6728).

The API of TableEditor was designed to closely mimic the Table constructor. Specifically, setName() accepts string. The other two were designed to provide an upgrade path to 5.0 where we eventually want to express object names as Name instances.

In order to unify the API of the editors and avoid an unnecessary BC break in the future, I want TableEditor#setName() to also accept a Name.

Implementation details

In order to accommodate this API change, we need to revert the introduction of the usage of TableEditor in all existing code, because a Table in 4.x is not guaranteed to have a valid (in terms of the SQL syntax) name. During the merge up, all those reverts will be discarded, so the 5.0.x code will keep using the editor.

Additionally, I'm unmarking the Table constructor as @internal for now. Unlike the UniqueConstraint and ForeignKeyConstraint editors, the existing Table editor hasn't fully replaced the usage of the constructor in 5.0, so expecting the end users to be able to not use the constructor is unrealistic. In its current state, it will lead to a worse user experience.

@morozov morozov marked this pull request as ready for review February 16, 2025 01:40
@morozov morozov requested a review from greg0ire February 16, 2025 01:40
@morozov morozov added this to the 4.3.0 milestone Feb 16, 2025
@morozov morozov merged commit 5019725 into doctrine:4.3.x Feb 17, 2025
66 checks passed
@morozov morozov deleted the table-editor-set-name branch February 17, 2025 00:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants