Skip to content

IBX-11939: Fixed the 6.0 migrations failing in a dry run before the tables exist - #53

Merged
Steveb-p merged 2 commits into
6.0from
feature/schema-late-install-6.0
Oct 28, 2026
Merged

Steveb-p merged 2 commits into
6.0from
feature/schema-late-install-6.0

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-11939

Related PRs:

Description:

A dry run executes nothing, so every migration in it gets the schema as it was before the run, without the tables that earlier migrations of the same run create. ConvertPostgreSqlSerialColumnsToIdentityMigration and RemoveDoctrineTypeCommentsMigration read the package's tables with $schema->getTable() to decide whether there's anything to do, so ibexa:doctrine:migrations:migrate --dry-run threw (There is no table with name "…" in the schema) on any database without them yet: the package installed on an existing project, or an empty database. They now skip when a table isn't in the schema, so the dry run lists them as skipped and says why. In a real run, the tables always exist by then.

The dry run's SQL is still incomplete: it can't see what earlier migrations of the same run would have created. For example, after a late install on PostgreSQL the dry run skips the SERIAL → IDENTITY conversion, which the real run does. That's how Doctrine's dry run works with SQL migrations; now it lists the migrations it can't evaluate as skipped, instead of crashing.

Checked in a 6.0 commerce project on MySQL 8.0, MariaDB 10.11, PostgreSQL 16 and SQLite: ibexa:doctrine:migrations:migrate --dry-run on an empty database passes, and installing the package on a fresh install without it with --dry-run, migrate and a second migrate ends identical to the fresh install. Fresh installs are byte-identical to before, and both 5.0 → 6.0 upgrades end identical to a fresh install (MySQL, MariaDB and PostgreSQL).

This is stacked on #56, the merge-up of 5.0 into 6.0, so the diff shows only the 6.0 part. #52 fixes the messages index name and FixMessengerMessagesIndexesMigration after legacy installs and in a dry run; it reaches 6.0 through that merge-up.

For QA:

On a 6.0 project with Doctrine Migrations enabled and installed without ibexa/messenger:

composer require ibexa/messenger
php bin/console ibexa:doctrine:migrations:migrate --dry-run

It passes now. ibexa:doctrine:migrations:migrate --dry-run on an empty database passes too.

…ables exist

A dry run executes nothing, so every migration in it gets the schema as it
was before the run, without the tables that earlier migrations create.
ConvertPostgreSqlSerialColumnsToIdentityMigration and
RemoveDoctrineTypeCommentsMigration read those tables, which threw. They now
skip a table that isn't in the schema; in a real run, it always is.
…exist

A dry run executes nothing, so when it installs the package, the tables that
ConvertPostgreSqlSerialColumnsToIdentityMigration and
RemoveDoctrineTypeCommentsMigration inspect aren't in the schema. The
migrations returned then, or left the missing tables out, which the dry run
reported as executed without SQL statements. They now skip, and the dry run
says why. In a real run the tables always exist by then.
@Steveb-p
Steveb-p force-pushed the feature/schema-late-install-6.0 branch from 0e7c184 to c58a516 Compare October 28, 2026 14:38
@Steveb-p
Steveb-p changed the base branch from base/ibx-11939-late-install-5.0-merged-6.0 to merge/5.0-to-6.0 October 28, 2026 14:38
Base automatically changed from merge/5.0-to-6.0 to 6.0 October 28, 2026 14:47
@Steveb-p
Steveb-p merged commit 1a49a97 into 6.0 Oct 28, 2026
11 checks passed
@Steveb-p
Steveb-p deleted the feature/schema-late-install-6.0 branch October 28, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants