Repository navigation
IBX-11939: Fixed messenger's index migration after legacy installs and in a dry run - #52
Merged
Merged
Conversation
…s exist A dry run executes nothing, so every migration in it gets the schema as it was before the run. FixMessengerMessagesIndexesMigration read a table that an earlier migration creates, which threw. It now returns when the table isn't in the schema; in a real run, it always is.
…ort does symfony/doctrine-messenger declares the (queue_name, available_at, delivered_at, id) index without a name, so Doctrine DBAL names it IDX_837A775AFB7336F0E3BD61CE16BA31DBBF396750. The Doctrine Migrations baseline and FixMessengerMessagesIndexesMigration create it with that name, while schema.yaml called it ibexa_messenger_messages_queue_available_delivered_idx. On 5.0, ibexa:install's doctrine:schema:update renamed it right after a SchemaBuilderEvent install, but on 6.0 it doesn't, so a 6.0 legacy install kept the other name, and FixMessengerMessagesIndexesMigration, which looks for IDX_837A..., tried to replace indexes the table never had. ibexa/doctrine-schema only takes named indexes, so schema.yaml now names it explicitly.
…t there The migration replaced the per-column indexes of the original schema whenever the table had no IDX_837A775AFB7336F0E3BD61CE16BA31DBBF396750. A table created under another name for that index has none of them, so its first DROP INDEX failed. It now also checks that ibexa_messenger_created_at_idx exists.
…before the table exists A dry run executes nothing, so when it installs the package, the table that FixMessengerMessagesIndexesMigration inspects isn't in its schema. The migration returned then, which the dry run reported as executed without SQL statements. It now skips, and the dry run says why. In a real run the table always exists by then.
Steveb-p
marked this pull request as ready for review
October 26, 2026 14:07
konradoboza
approved these changes
Oct 27, 2026
bnowak
approved these changes
Oct 27, 2026
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.
Related PRs:
Description:
FixMessengerMessagesIndexesMigrationreplaces the 3 per-column indexes of the original schema with the composite one Symfony's Doctrine transport declares, which DBAL namesIDX_837A775AFB7336F0E3BD61CE16BA31DBBF396750. It decided whether to run by looking for that name only. #22 gave the composite index toschema.yamlas well, but called itibexa_messenger_messages_queue_available_delivered_idx. On 5.0,ibexa:installrenames it to Symfony's name in itsdoctrine:schema:updatestep, so nothing showed. On 6.0 that step leaves the messenger table alone, so after a legacy installibexa:doctrine:migrations:migrateran the migration and failed on its firstDROP INDEX ibexa_messenger_created_at_idx(MySQL1091 Can't DROP, PostgreSQL42704 index ... does not exist). Legacy being 6.0's default install path, that blocks themigratestep documented for adding a package.schema.yamlnow names the indexIDX_837A775AFB7336F0E3BD61CE16BA31DBBF396750. ibexa/doctrine-schema only takes named indexes, so it has to be spelled out. Fresh installs on both paths now end with the same name, and Symfony's own schema declaration agrees.FixMessengerMessagesIndexesMigrationalso runs only whenibexa_messenger_created_at_idxis there, so a table without the old indexes is left alone. That's the case for a 6.0 legacy install made with theschema.yamlfrom #22: it keepsibexa_messenger_messages_queue_available_delivered_idx, which covers the same columns. No release contains #22 yet, so changing the migration's condition only affects development databases.The first and last commits fix
migrate --dry-run: a dry run executes nothing, so the migration got a schema withoutibexa_messenger_messageswhen the package is installed in the same run, andgetTable()threw. It now skips when the table isn't there, so the dry run lists it as skipped and says why. In a real run the table always exists by then.Checked in a 5.0 and a 6.0 commerce project on MySQL 8.0, MariaDB 10.11, PostgreSQL 16 and SQLite: the migration turns a table with the 3 per-column indexes into exactly the fresh install's, and installing the package late,
--dry-runfirst, ends identical to a fresh install. On MySQL, MariaDB and PostgreSQL it skips a table under either composite name, a 6.0 legacy install followed bymigratepasses now, fresh legacy installs equal fresh Doctrine Migrations installs by index name, and the 4.6 upgrades are unchanged.For QA:
On a 6.0 project installed the legacy way (without
doctrine_migrations: true):It passes now; before, it failed in
FixMessengerMessagesIndexesMigrationwithCan't DROP 'ibexa_messenger_created_at_idx'.