Review main Work in progress Stale

95193[WIP][FEATURE] Add database schema update command

Stefan Bürk CR 0 V 0 Expert +1066 −0 updated 09/02/26, 13:36

Commit message

Bringing the database schema in line with `ext_tables.sql` and TCA
was only possible through the install tool, or as a side effect of
`extension:setup`, which applies the safe changes of every package
without a way to look at them first.

The new `database:schema:update` command exposes the analyzer
directly. Without options it applies only changes that do not remove
anything. The removal options follow the two steps a removal takes:

* `--rename` renames tables and columns that are no longer expected
  by moving them behind the `zzz_deleted_` prefix. Their data is
  kept.
* `--drop` removes what already carries that prefix, and unused
  indexes, which hold no data of their own and therefore have no
  first step.
* `--destructive` performs both, and `--all` puts the safe changes in
  front of them.

Further options are `--dry-run`, `--rounds`, and `--connection` and
`--table` to limit the scope.

Every step runs on its own analysis, and a round runs every requested
step once. Two change sets of the same table are therefore never
applied from the same analysis - on a platform that cannot alter a
table in place, the second alteration would be rendered from a table
state the first one has already left.

Dropping runs before renaming, so a single round never removes what
it has just renamed. Removing something entirely takes two rounds and
has to be asked for with `--rounds=2`, which keeps the grace period
the deletion prefix exists for.

When the schema has not converged after the last round, the number of
pending change sets is reported rather than passing silently.

`--sql` writes the statements of the requested steps and nothing
else, terminated, so the output can be piped into a file or a
database client. It applies nothing. `--export` writes the same
statements to a file while the readable output stays on screen, which
allows keeping a record of what an actual run applied.

What a change set does is described per table, the same way the
install tool describes it: what happens to the table as the headline,
and one section per kind of change below it listing what it affects.
A change shows both declarations, stacked as a removed and an added
line rather than side by side, which keeps them comparable instead of
doubling the width of the column exactly where they differ. A change
set that names nothing - creating, dropping or renaming the table
itself - stays a single line, since a box would hold a headline and
nothing else.

`--sql` output is untouched by this: it stays statements only.

This change concludes the ongoing streamlining of the database
analyzer stack.

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 13
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/93/95193/13 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/93/95193/13 && 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. main 95194[WIP][!!!][TASK] Remove the array shaped schema migrator API Based on this change Work in progress Merge conflict Stefan Bürk CR 0 V 0 database-analyzer Nightmare +1441 −3637
  3. 95193 [WIP][FEATURE] Add database schema update command This change

  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 2

Files 4

Review log 1326

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  15. 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/106452

  16. Stefan Bürk rebased onto patch set 9 V +1 08/14/26, 20:48

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

  18. Stefan Bürk rebased onto patch set 10 V +1 08/31/26, 10:28

  19. core-ci voted on patch set 10 V -1 08/31/26, 11:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107412

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

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

  22. Stefan Bürk rebased onto patch set 12 V -1 09/02/26, 11:40

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

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

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