Upgrading doctrine/dbal 3 to 4
Breaking3.10.6 → 4.5.0Breaking35Platform2Deprecated55New38Changed41Fixed58Other113
Fetching 32 releases from GitHub…27 / 32
BreakingUpgrade verdict
35 breaking changes and 2 platform requirement changes.
In plain terms
- Removes DB2Platform::getPreAlterTableIndexForeignKeySQL().
- Renames Identifier::toSql() to Identifier::toSQL().
- Removes the final constructor for Type.
- Renames column in indexes and constraints.
Must act Top 5 of 92 that need code or config changes
doctrine/dbal publishes an official migration guide for version 4. It covers more than the release notes do.
Upgrade guide ↗PHP requirement changed in 4.3.0: ^7.4 || ^8.0 → ^8.2.
What you must change
Breaking35
Removes DB2Platform::getPreAlterTableIndexForeignKeySQL().
DB2Platform::getPreAlterTableIndexForeignKeySQL()Renames Identifier::toSql() to Identifier::toSQL().
Identifier::toSql()Identifier::toSQL()Removes the final constructor for Type.
TypeRenames column in indexes and constraints.
Removes handling unique constraint column names as associative array.
CompositeExpression no longer allows empty instances and is now immutable.
CompositeExpressionRemoves defaults for MySQL table charset, collation and engine.
Removes hard-coded default values of maximum field lengths.
Column precision no longer defaults to 10; scale and precision must be explicit for decimal columns.
Removes the column name index.
Drops support for Postgres 9.
Drops support for MySQL 5.6 and older and MariaDB 10.2.6 and older.
Drops support for MariaDB 10.4.2 and older.
Drops support for Oracle 12c and older.
Removes AbstractPlatform::hasNative*Type() methods and Type::requiresSQLCommentHint().
AbstractPlatform::hasNative*Type()Type::requiresSQLCommentHint()Removes support for driver name aliases.
Removes extension via Doctrine Event Manager.
Doctrine Event ManagerRemoves Connection::$_schemaManager() and Connection::getSchemaManager().
Connection::$_schemaManager()Connection::getSchemaManager()Removes Connection::$_expr and Connection::getExpressionBuilder().
Connection::$_exprConnection::getExpressionBuilder()Updates the TableEditor API.
TableEditorRemoves AbstractName and marks GenericName as internal.
AbstractNameGenericNameUses InvalidState instead of NameIsNotInitialized.
InvalidStateNameIsNotInitializedRemoves SQLite schema emulation leftovers.
Refactors AbstractSchemaManager::fetch*/select*() API.
AbstractSchemaManagerStrict scalar type declarations are now used throughout the codebase.
Scalar parameter and return value types are added to method signatures.
Transaction-related Statement methods now return void and throw an exception on failure.
StatementConnection and Statement methods that returned false on failure now return void.
ConnectionStatementReworks AbstractPlatform::get*Expression() methods.
AbstractPlatform::get*Expression()Converts ParameterType to an enum.
ParameterTypeConverts enum-like classes to enums.
Makes the OFFSET in LIMIT queries a non-nullable integer defaulting to 0.
Connection::quote() can now only quote strings.
Connection::quote()Represents table columns as a list in declaration order.
Improves the Schema Diff API with no more public properties and near immutability.
Platform2
Reintroduces PHP 8.2 support.
Requires PHP 8.3.
Deprecations to plan for
Deprecated55
Deprecates Column::getType() in favor of Column::getTypeName().
Column::getType()Column::getTypeName()Deprecates SimpleArrayType.
SimpleArrayTypeIntrospects unique constraints, deprecating prior behavior.
Deprecates table mutators.
Deprecates column mutators.
Deprecates Schema features and introduces SchemaEditor.
SchemaSchemaEditorIntroduces TableDiff::getIndexRenames().
TableDiff::getIndexRenames()Deprecates the Parser\Exception interface.
Parser\ExceptionDeprecates not specifying either of Oracle host and connectstring.
hostconnectstringDeprecates creation of empty namespaces.
Deprecates using keys of table-scoped object collections as names.
Deprecates extending schema classes.
Deprecates TableDiff::getDroppedForeignKeys().
TableDiff::getDroppedForeignKeys()Deprecates unnamed foreign key constraints in $droppedForeignKeys of TableDiff.
TableDiff$droppedForeignKeysDeprecates overwriting existing foreign key constraints.
Deprecates Sequence setters.
SequenceDeprecates AbstractAsset::getName().
AbstractAsset::getName()Deprecates AbstractAsset::isQuoted().
AbstractAsset::isQuoted()Deprecates the "service" connection parameter for oci8 and pdo_oci.
serviceDeprecates the new MariaDB110700Platform class.
MariaDB110700PlatformDeprecates ForeignKeyConstraint features and introduces ForeignKeyConstraintEditor.
ForeignKeyConstraintForeignKeyConstraintEditorDeprecates UniqueConstraint features and introduces UniqueConstraintEditor.
UniqueConstraintUniqueConstraintEditorDeprecates support for MariaDB 10.5.
Deprecates Column features and introduces ColumnEditor.
ColumnColumnEditorDeprecates the "version" column platform option.
versionIntroduces JSONB type and deprecates the "jsonb" column platform option.
JSONBjsonbDeprecates Index features and introduces IndexEditor.
IndexIndexEditorDeprecates invalid auto-increment column definitions on SQLite.
Deprecates auto-increment being dropped with the primary key on MySQL.
Deprecates modified indexes in TableDiff.
TableDiffDeprecates modified foreign keys in TableDiff.
TableDiffFixes a false-positive primary key column length deprecation.
Introduces Identifier::toNormalizedValue() and deprecates AbstractSchemaManager::_normalizeName().
Identifier::toNormalizedValue()AbstractSchemaManager::_normalizeName()Deprecates introspection of unquoted table names with dot.
Deprecates AbstractSchemaManager::_getPortableTableDefinition().
AbstractSchemaManager::_getPortableTableDefinition()Deprecates usage of Schema as AbstractAsset.
SchemaAbstractAssetDeprecates Table::columnsAreIndexed().
Table::columnsAreIndexed()Deprecates conversion of RESTRICT to NO ACTION.
Deprecates introspection of incomplete SQLite schema.
Deprecates mixing qualified and unqualified names.
Deprecates AbstractAsset::getQuotedName().
AbstractAsset::getQuotedName()Deprecates AbstractAsset::getShortestName().
AbstractAsset::getShortestName()Deprecates AbstractAsset::_setName().
AbstractAsset::_setName()Deprecates empty index name.
Deprecates AbstractAsset namespace-related methods.
AbstractAssetDeprecates Sequence::isAutoIncrementsFor().
Sequence::isAutoIncrementsFor()Deprecates altering table configuration.
Deprecates reserved keyword lists.
Deprecates relying on the current implementation of the database object name parser.
Deprecates AbstractPlatform::quoteIdentifier().
AbstractPlatform::quoteIdentifier()Deprecates Table::removeForeignKey() and Table::removeUniqueConstraint().
Table::removeForeignKey()Table::removeUniqueConstraint()Deprecates dropping columns referenced by constraints.
Deprecates support for PostgreSQL 10 and 11.
Adds a deprecation layer for TableDiff methods.
TableDiffDeprecates MariaDB 10.4 and MySQL 5.7 support.