DoctrineMigrationsBundle

Symfony bundle that integrates the Doctrine Migrations library for versioned database schema changes

Library
Composer
v4.0.0
4,303stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
54/100Fair
Development Activity28
Maintenance24
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture75
Code Quality76
Innovation62
Learning Curve80

DoctrineMigrationsBundle wires the standalone doctrine/migrations library into a Symfony application’s dependency-injection container, configuration system, and console. It lets teams version their database schema as ordered PHP migration classes and apply, revert, or diff those changes predictably across every environment the application runs in, instead of hand-editing schemas or relying on ORM auto-sync in production.

What You Get

  • Symfony console commands for generating, running, reverting, and diffing database migrations
  • DI container integration so migrations have access to the app’s configured Doctrine DBAL connections and entity managers
  • Bundle-level YAML/PHP configuration (doctrine_migrations:) for migration paths, namespaces, and storage table naming
  • A MigrationsRepository abstraction and event listeners for hooking into the migration lifecycle
  • Support for multiple named migration sets/connections in a single application

Common Use Cases

  • Versioning database schema changes in a Symfony application so every environment (dev, staging, production) applies the same ordered set of changes
  • Generating a migration automatically from the diff between the current database schema and Doctrine entity mappings
  • Running migrations as part of a deployment pipeline (doctrine:migrations:migrate --no-interaction) to keep production schema in sync with code
  • Rolling back a bad schema change in production by reverting to a specific prior migration version

Under The Hood

Architecture — The bundle is a thin Symfony integration layer: DoctrineMigrationsBundle.php registers the bundle with Symfony’s kernel, DependencyInjection/ contains the configuration tree and compiler pass that binds doctrine/migrationsDependencyFactory into Symfony’s container, and EventListener/ hooks migration events (e.g. schema-change notifications) into Symfony’s event dispatcher; config/services.php wires the concrete service definitions. Tech Stack — PHP 8.4+, requiring doctrine/migrations ^3.2, doctrine/dbal ^4, doctrine/doctrine-bundle ^3, and Symfony components (config, console, dependency-injection, framework-bundle) ^6.4/^7/^8, with a small Twig-templated Collector for the Symfony profiler/web debug toolbar. Code Quality — The project runs PHPStan (phpstan.neon.dist) and PHP_CodeSniffer (phpcs.xml.dist) in CI, plus a tests/ suite exercising the DI configuration and event listeners; a SECURITY.md documents the vulnerability-reporting process. API Design — Configuration follows standard Symfony bundle conventions (a single doctrine_migrations: config key, auto-registered console commands), so a developer already familiar with Symfony bundles or Doctrine ORM has almost no new concepts to learn beyond the underlying doctrine/migrations command set.

Used by 5 apps in this directory

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search