Skip to content

Upgrading doctrine/doctrine-bundle 1 to 2

Breaking1.12.13 → 2.19.3Breaking11Deprecated19New51Changed62Fixed100Other105

BreakingUpgrade verdict

11 breaking changes.

  • The bundle no longer works with Symfony 5; you must upgrade Symfony to use this version.
  • Old logging configuration for the database layer is gone; use the current logging setup instead.
  • Services that relied on being autowired by common interface names will no longer be injected automatically.
  • The old command for generating entities is gone; use the maker tooling instead.
Top 5 of 30 that need code or config changes

PHP requirement changed in 2.14.0: ^7.1 || ^8.0 → ^8.1.

Breaking11
Removes support for Symfony 5.
Removes legacy DBAL logging services and parameters.
Removes autowiring aliases for common interfaces.
Removes the deprecated entity generation command.
Removes deprecated features.
Drops support for DoctrineCacheBundle.
DoctrineCacheBundle
Removes deprecated functionality from DoctrineCommand.
DoctrineCommand
No longer implements the deprecated RegistryInterface.
RegistryInterface
Adds Twig 4 compatibility, which is a backward compatibility break.
Moves the enable_native_lazy_objects config node outside the entity managers configuration.
enable_native_lazy_objects
Makes the container argument in the ContainerRepositoryFactory constructor mandatory.
ContainerRepositoryFactory
Deprecated19
Conditionally deprecates proxy-related settings.
Deprecates methods related to annotations and yaml.
Deprecates the use_savepoints option when using DBAL 4.
use_savepoints
Deprecates the disable_type_comments option.
disable_type_comments
Deprecates passing an event manager to CF::createConnection().
CF::createConnection()
Deprecates the report_fields_where_declared option.
report_fields_where_declared
Fully deprecates controller resolver auto mapping.
Deprecates not setting doctrine.orm.controller_resolver.auto_mapping.
doctrine.orm.controller_resolver.auto_mapping
Deprecates EventSubscriberInterface.
EventSubscriberInterface
Deprecates all ORM proxy commands.
Deprecates sharding functionality.
Deprecates the "collate" default table option.
collate
Deprecates the override_url configuration option.
override_url
Deprecates mixing the url option with host, dbname and a few others.
urlhostdbname
Deprecates the Blacklist and WellKnown schema filters.
BlacklistWellKnown
Resolves DBAL 2.11 master/slave deprecations.
Deprecates the doctrine:query:sql command.
doctrine:query:sql
Deprecates ImportDoctrineCommand.
ImportDoctrineCommand
Deprecates .class parameters.