CI: SQLite preserve indexes/FKs when altering an introspected table - #1
Open
fballiano wants to merge 4 commits into
Open
CI: SQLite preserve indexes/FKs when altering an introspected table#1fballiano wants to merge 4 commits into
fballiano wants to merge 4 commits into
Conversation
…spected table
The table-recreation path maps index and foreign-key columns to the
altered table through getDiffColumnNameMap(), which is keyed by the
bare column names (Column::getName()). The index and foreign-key
column accessors of an introspected table return the names in their
quoted form ('"sku"'), so every map lookup missed and the branch
meant to drop indexes referencing dropped columns silently dropped
every index and foreign key of the table instead.
Unquote the column names before the lookup, so only indexes and
foreign keys whose columns were actually dropped are removed.
Signed-off-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
fballiano
force-pushed
the
fix/sqlite-alter-table-drops-indexes
branch
2 times, most recently
from
June 10, 2026 16:24
8502adc to
abc5d06
Compare
…spected table
When the altered table is obtained through the introspection API, its
index and foreign-key column names are marked as quoted, so the legacy
Index::getColumns() / ForeignKeyConstraint::getLocalColumns() accessors
return them in quoted form ('"sku"'). The SQLite table-recreation path
maps those columns to the altered table through getDiffColumnNameMap(),
which is keyed by the unquoted column names, so every lookup missed and
the branch meant to drop indexes referencing dropped columns silently
dropped every index and foreign key (and the primary key) of the table
instead.
Read the referencing column names through the non-deprecated
Index::getIndexedColumns() and
ForeignKeyConstraint::getReferencingColumnNames() accessors and compare
their unquoted identifier values, so the lookup is agnostic of whether
the table was introspected or built in memory.
Add a regression test to SchemaManagerFunctionalTestCase so the
scenario, which is not platform-specific, runs against every platform.
Signed-off-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
fballiano
force-pushed
the
fix/sqlite-alter-table-drops-indexes
branch
from
June 10, 2026 16:30
abc5d06 to
a03a27d
Compare
…ospection The referential actions of a foreign key created without explicit actions are reported inconsistently across platforms (MariaDB reports RESTRICT, MySQL reports NO ACTION), so the post-alteration foreign keys are compared against the pre-alteration introspection instead of the in-memory definition.
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.
Internal pull request to run the full CI matrix on the fork for the changes proposed upstream in doctrine#7392. Safe to close once CI has reported.