#110253Prepare database abstraction layer for Doctrine DBAL 5.x
Description
doctrine/dbal 4.3 and 4.4 deprecated a large part of the schema object and
schema manager API that TYPO3 builds upon. main, 14.3 and 13.4 all use
doctrine/dbal ~4.4.3, so the deprecation surface is identical on all three
branches.
Nothing is currently visible: doctrine/deprecations defaults to “none” and
TYPO3 never enables it. This is forward-compatibility work for DBAL 5.x, not
an active defect.
An audit identified three items that are not part of the upstream deprecation
list but dominate the effort:
1. The new introspect*() API bypasses the protected _getPortable*() hooks
entirely. Introspection now runs through IntrospectingSchemaProvider and the
per-platform MetadataProvider implementations, both final/internal. TYPO3
carries six _getPortable* overrides (Doctrine type from column comment,
MySQL default value unescaping, MySQL index prefix lengths). Migrating
naively drops that behaviour silently and persists wrong column metadata in
the “database_schema” cache.
2. TYPO3\CMS\Core\Database\Schema\TableDiff extends the Doctrine class but
deliberately does not call parent::__construct(). The inherited
getDroppedForeignKeyConstraintNames() reads Doctrine’s uninitialised private
property and raises an Error. Dormant today, but it is the method DBAL 5
switches to.
3. Two places rely on the array keys of Table::getIndexes() and
Table::getForeignKeys() being names. Those become lists in DBAL 5, turning
an overwrite into an append (duplicate indexes and foreign keys).
Related to #106495, which deferred exactly this scope.
Work is split into child issues. Behaviour-preserving changes are backported to
14.3 and 13.4; anything that changes generated DDL, diff content or public API
stays on main.
There are possible more to come in the future.
Reviews 15
- 13.4 95065[TASK] Use Doctrine introspection API for table and database names
- 14.3 95064[TASK] Use Doctrine introspection API for table and database names
- main 94873[TASK] Use Doctrine introspection API for table and database names
- 13.4 94921[TASK] Clean up unit test mock platforms for Doctrine DBAL
- 14.3 94920[TASK] Clean up unit test mock platforms for Doctrine DBAL
- main 94872[TASK] Clean up unit test mock platforms for Doctrine DBAL
- 13.4 94904[TASK] Do not rely on Doctrine schema object array keys
- 14.3 94903[TASK] Do not rely on Doctrine schema object array keys
- main 94871[TASK] Do not rely on Doctrine schema object array keys
- 13.4 94893[BUGFIX] Fix broken TableDiff::getDroppedForeignKeyConstraintNames()
- 14.3 94892[BUGFIX] Fix broken TableDiff::getDroppedForeignKeyConstraintNames()
- main 94870[BUGFIX] Fix broken TableDiff::getDroppedForeignKeyConstraintNames()
- 13.4 94889[TASK] Avoid deprecated Doctrine DBAL identifier quoting
- 14.3 94888[TASK] Avoid deprecated Doctrine DBAL identifier quoting
- main 94869[TASK] Avoid deprecated Doctrine DBAL identifier quoting
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[TASK] Prepare database abstraction layer for Doctrine DBAL 5.x Resolves: #110253 Releases: main
Subtasks 5
- Task #110254Avoid deprecated Doctrine DBAL identifier quoting API
- Bug #110255Fix broken TableDiff::getDroppedForeignKeyConstraintNames()
- Task #110256Do not rely on Doctrine schema object array keys
- Task #110257Clean up unit test mock platforms for Doctrine DBAL
- Task #110258Use Doctrine introspection API for table and database names