Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Stale Breaking

95194[WIP][!!!][TASK] Remove the array shaped schema migrator API

Stefan Bürk CR 0 V 0 Nightmare +1441 −3637 updated 09/02/26, 13:37

Commit message

`SchemaMigrator::getUpdateSuggestions()` reported statements grouped
by operation kind and keyed by their own md5 hash, and `migrate()`
executed a selection of those hashes one statement at a time. That
model is what allowed a table to be left in a state it cannot be left
in, and every consumer had to re-derive from the array keys what was
safe. Nothing uses it anymore.

Removed with it:

* the suggestion building half of `ConnectionMigrator`, which is only
  the schema comparison now and is renamed to
  `ConnectionSchemaComparator` accordingly,
* `Schema\TableDiff`, `Schema\SchemaDiff` and `Schema\Comparator`,
  the mutable copies of doctrine classes that the in place comparison
  needed. Two PHPStan baseline entries disappear with them: both said
  that TYPO3 extends a class doctrine marks `@final`.

The last consumers are switched over:

* `DatabaseUpgradeWizardsService::addMissingTablesAndFields()` and
  `SetupDatabaseService::importDatabaseData()` apply everything that
  removes nothing, and report per table rather than per statement,
  which is what is applied.
* `AbstractSchemaBasedTestCase` gained `applySafeChanges()` and
  `applyRemoval()` for the same reason.

`SchemaMigrator::install()` stays, as a wrapper around `applySafe()`.
`typo3/testing-framework` creates the database of every functional
test through it, so removing it here would break the test suite of
core and of every extension. Its `$createOnly` argument is gone,
which no caller passes.

Dropping create only mode is a behaviour change worth stating: it
left column and index changes of a table out, and a table is changed
as a whole now. That is what makes repeated runs converge - skipping
a table because it also needs a column change left the missing column
missing, and `getBlockingDatabaseAdds()` reporting it forever.

Three tests asserted the removed behaviour and are rewritten rather
than dropped, including a split into an all platform and a MySQL only
case: the fixture behind it indexes a text column by prefix length,
which SQLite and PostgreSQL do not support.

This change is part of the ongoing streamlining of the database
analyzer stack.

`ConnectionSchemaComparator` becomes a stateless service. It used to
be constructed per connection and per run, holding the connection
name, the connection and the expected tables as properties, which is
what an object per comparison needs but a service must not have. It
now takes only the connection pool and receives everything that
varies between two runs as one immutable
`Dto\SchemaComparisonRequest`, passed to `compare()`. The deletion
prefix becomes a constant, and the class becomes `readonly`.

Three private helpers had no caller left and are removed with it,
including the one that threw a generic `\RuntimeException`.

The schema name derivation of #108028 moves along with the rename.
`buildExpectedSchemaDefinitions()` takes the schema manager and reads
the name from `createSchemaConfig()->getName()`, the same source the
introspected schema uses, rather than from the raw database name,
which breaks on a database name containing a dot.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 15
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/94/95194/15 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/94/95194/15 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 8

  1. main 95195[WIP][!!!][TASK] Remove SchemaMigrator::install() Based on this change Work in progress Merge conflict Stefan Bürk CR 0 V 0 database-analyzer Normal +62 −37
  2. 95194 [WIP][!!!][TASK] Remove the array shaped schema migrator API This change

  3. main 95193[WIP][FEATURE] Add database schema update command This change is based on it Work in progress Stefan Bürk CR 0 V 0 database-analyzer Expert +1066 −0
  4. main 95192[WIP][TASK] Rework database analyzer stack This change is based on it Work in progress Merge conflict Stefan Bürk CR 0 V 0 database-analyzer Nightmare +5239 −372
  5. main 95191[WIP][TASK] Generate table option changes without platform hooks This change is based on it Work in progress Stefan Bürk CR 0 V 0 database-analyzer Hard +92 −282
  6. main 95190[WIP][TASK] Reduce column type comment handling to MySQL This change is based on it Work in progress Stefan Bürk CR 0 V 0 database-analyzer Normal +50 −105
  7. main 95189[WIP][TASK] Use non-deprecated doctrine introspection API This change is based on it Work in progress Stefan Bürk CR 0 V 0 → 14.3, 13.4 database-analyzer Expert +450 −599
  8. main 95263[TASK] Raise doctrine/dbal to ~4.4.4 This change is based on it Merged Stefan Bürk CR +2 V +2 → 14.3, 13.4 database-analyzer Normal +57 −5

Issues 3

Files 20

Review log 1531

Show 36 earlier messages
  1. Stefan Bürk uploaded patch set 1 08/09/26, 21:00

  2. core-ci voted on patch set 1 V -1 08/09/26, 21:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106234

  3. Stefan Bürk rebased onto patch set 2 V -1 08/09/26, 22:35

  4. core-ci voted on patch set 2 V +1 08/09/26, 22:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106238

  5. Stefan Bürk uploaded patch set 3 V +1 08/11/26, 00:32

  6. core-ci voted on patch set 3 V +1 08/11/26, 00:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106358

  1. Stefan Bürk uploaded patch set 4 V +1 08/11/26, 04:00

  2. core-ci voted on patch set 4 V +1 08/11/26, 04:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106373

  3. Stefan Bürk rebased onto patch set 5 V +1 08/11/26, 05:17

  4. core-ci voted on patch set 5 V -1 08/11/26, 05:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106392

  5. core-ci voted on patch set 5 V +1 08/11/26, 10:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106392

  6. Stefan Bürk rebased onto patch set 6 V +1 08/11/26, 11:38

  7. core-ci voted on patch set 6 V +1 08/11/26, 12:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106423

  8. Stefan Bürk rebased onto patch set 7 V +1 08/11/26, 13:29

  9. core-ci voted on patch set 7 V +1 08/11/26, 13:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106439

  10. Stefan Bürk uploaded patch set 8 08/11/26, 14:14

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  11. core-ci voted on patch set 8 V +1 08/11/26, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106453

  12. Stefan Bürk uploaded patch set 9 V +1 08/14/26, 20:48

  13. core-ci voted on patch set 9 V +1 08/14/26, 21:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106729

  14. Stefan Bürk uploaded patch set 10 V +1 08/31/26, 10:28

  15. Stefan Bürk updated the commit message in patch set 11 08/31/26, 10:34

  16. Stefan Bürk updated the commit message in patch set 12 08/31/26, 10:34

  17. core-ci voted on patch set 10 V +1 08/31/26, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107413

  18. core-ci voted on patch set 11 V +1 08/31/26, 10:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107415

  19. core-ci voted on patch set 12 V +1 08/31/26, 11:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107417

  20. Stefan Bürk rebased onto patch set 13 V +1 09/02/26, 10:40

  21. core-ci voted on patch set 13 V +1 09/02/26, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107598

  22. Stefan Bürk uploaded patch set 14 V +1 09/02/26, 11:40

  23. core-ci voted on patch set 14 V +1 09/02/26, 11:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107614

  24. Stefan Bürk rebased onto patch set 15 V +1 09/02/26, 13:16

  25. core-ci voted on patch set 15 V +1 09/02/26, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107633