GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [ticket/17746] Keep indexes that are dropped and added in one schema change by bonelifer · Pull Request #7093 · phpbb/phpbb

Conversation

@bonelifer

@bonelifer bonelifer commented Oct 19, 2026

Copy link
Copy Markdown
Member

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

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_name drops and re-adds a unique index with an extra column in one schema change, on the configured database.
  • New 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bonelifer bonelifer mentioned this pull request Oct 19, 2026
[ticket/17747] Declare localise_meridiem() protected static #7094
Merged
4 tasks done
@bonelifer
[ticket/17746] Keep indexes that are dropped and added in one schema …
4e8e6ef
…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
bonelifer force-pushed the ticket/17746 branch from bd0399b to 4e8e6ef Compare October 20, 2026 18:20
@marc1706 marc1706 added the 4.0 (Triton) 🔮 label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

4.0 (Triton) 🔮

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bonelifer @marc1706
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.