Skip to content

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.

  • Removes DB2Platform::getPreAlterTableIndexForeignKeySQL().
  • Renames Identifier::toSql() to Identifier::toSQL().
  • Removes the final constructor for Type.
  • Renames column in indexes and constraints.
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.

Breaking35
Removes DB2Platform::getPreAlterTableIndexForeignKeySQL().
DB2Platform::getPreAlterTableIndexForeignKeySQL()
Renames Identifier::toSql() to Identifier::toSQL().
Identifier::toSql()Identifier::toSQL()
Removes the final constructor for Type.
Type
Renames column in indexes and constraints.
Removes handling unique constraint column names as associative array.
CompositeExpression no longer allows empty instances and is now immutable.
CompositeExpression
Removes 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 Manager
Removes Connection::$_schemaManager() and Connection::getSchemaManager().
Connection::$_schemaManager()Connection::getSchemaManager()
Removes Connection::$_expr and Connection::getExpressionBuilder().
Connection::$_exprConnection::getExpressionBuilder()
Updates the TableEditor API.
TableEditor
Removes AbstractName and marks GenericName as internal.
AbstractNameGenericName
Uses InvalidState instead of NameIsNotInitialized.
InvalidStateNameIsNotInitialized
Removes SQLite schema emulation leftovers.
Refactors AbstractSchemaManager::fetch*/select*() API.
AbstractSchemaManager
Strict 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.
Statement
Connection and Statement methods that returned false on failure now return void.
ConnectionStatement
Reworks AbstractPlatform::get*Expression() methods.
AbstractPlatform::get*Expression()
Converts ParameterType to an enum.
ParameterType
Converts 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.
Deprecated55
Deprecates Column::getType() in favor of Column::getTypeName().
Column::getType()Column::getTypeName()
Deprecates SimpleArrayType.
SimpleArrayType
Introspects unique constraints, deprecating prior behavior.
Deprecates table mutators.
Deprecates column mutators.
Deprecates Schema features and introduces SchemaEditor.
SchemaSchemaEditor
Introduces TableDiff::getIndexRenames().
TableDiff::getIndexRenames()
Deprecates the Parser\Exception interface.
Parser\Exception
Deprecates not specifying either of Oracle host and connectstring.
hostconnectstring
Deprecates 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$droppedForeignKeys
Deprecates overwriting existing foreign key constraints.
Deprecates Sequence setters.
Sequence
Deprecates AbstractAsset::getName().
AbstractAsset::getName()
Deprecates AbstractAsset::isQuoted().
AbstractAsset::isQuoted()
Deprecates the "service" connection parameter for oci8 and pdo_oci.
service
Deprecates the new MariaDB110700Platform class.
MariaDB110700Platform
Deprecates ForeignKeyConstraint features and introduces ForeignKeyConstraintEditor.
ForeignKeyConstraintForeignKeyConstraintEditor
Deprecates UniqueConstraint features and introduces UniqueConstraintEditor.
UniqueConstraintUniqueConstraintEditor
Deprecates support for MariaDB 10.5.
Deprecates Column features and introduces ColumnEditor.
ColumnColumnEditor
Deprecates the "version" column platform option.
version
Introduces JSONB type and deprecates the "jsonb" column platform option.
JSONBjsonb
Deprecates Index features and introduces IndexEditor.
IndexIndexEditor
Deprecates invalid auto-increment column definitions on SQLite.
Deprecates auto-increment being dropped with the primary key on MySQL.
Deprecates modified indexes in TableDiff.
TableDiff
Deprecates modified foreign keys in TableDiff.
TableDiff
Fixes 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.
SchemaAbstractAsset
Deprecates 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.
AbstractAsset
Deprecates 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.
TableDiff
Deprecates MariaDB 10.4 and MySQL 5.7 support.