Repository navigation
Conversation
4 tasks done
…change Doctrine reports an index dropped and added again with the same name but other columns as a modified index. The comparator rebuilt the table diff from the added and dropped indexes only, so the change was lost and the old index stayed. Add each modified index as dropped and added. When a migration drops an index by its unprefixed key name and the table also has the generated, prefixed name, drop the generated index. PHPBB-17746
bonelifer
force-pushed
the
ticket/17746
branch
from
October 20, 2026 18:20
bd0399b to
4e8e6ef
Compare
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.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17746
When a migration drops an index and adds it back under the same name with other columns, in one
perform_schema_changes()call, the change is lost on 4.0 and the old index stays. Doctrine reports such an index as modified (TableDiff::getModifiedIndexes()), and\phpbb\db\doctrine\comparator::compareTables()rebuilt the diff from the added and dropped indexes only. Each modified index is now added to both lists, its old definition as dropped and its new one as added.\phpbb\db\tools\doctrine::schema_index_drop()also changes: when a migration drops an index by its unprefixed key name and the table has both that name and the generated prefixed name, the generated one is dropped, since that's the index phpBB created.This is against master because 3.3.x doesn't use Doctrine for schema changes.
Tests:
phpbb_dbal_db_tools_test::test_perform_schema_changes_replaces_index_with_same_namedrops and re-adds a unique index with an extra column in one schema change, on the configured database.phpbb_dbal_doctrine_comparator_test, with no database: the modified index produces SQL on the MySQL, PostgreSQL and SQLite platforms, and the legacy key name drops the generated index.Claude ran every
phpbb_dbal_test (247) on SQLite, MySQL 8.0 and PostgreSQL 16, in throwaway containers, with PHP 8.4. They all pass; the only skips are ones that already exist (long index names, and database features like multi-insert). Without the fix, the five new tests fail on SQLite, and the database test fails on MySQL and PostgreSQL too. The code sniffer finds nothing in the changed files.Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code