Skip to content
CAI
Software that uses CAICheck a score

doctrine/migrations

57.6

Adequate · 17 November 2026

7.4k

lines of production code

PHP

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Initial project scaffolding and configuration

The repository is initialized with essential configuration files, including a PHPUnit test suite, PHPStan static analysis rules, and PHPCS coding standards. It also includes a GitHub Actions workflow for continuous integration, an AppVeyor configuration for Windows testing, and a build script to generate a PHAR distribution using Box. Documentation is updated with a new README, a security reporting policy, and an upgrade guide detailing breaking changes for versions 3.1 and 3.6.

(repo-wide) · high confidence

Introduce new metadata model classes and storage interfaces

The \src/Metadata\ directory has been restructured to introduce a new set of value-object classes for tracking migration state, including \AvailableMigration\, \AvailableMigrationsList\, \AvailableMigrationsSet\, \ExecutedMigration\, \ExecutedMigrationsList\, \MigrationPlan\, and \MigrationPlanList\. These classes replace previous inline structures with dedicated types for representing available and executed migrations, as well as migration plans with execution results. Additionally, new interfaces \MetadataStorage\ and \MetadataStorageConfiguration\ have been added to define the contract for storage implementations, alongside a new \TableMetadataStorageConfiguration\ class that allows customization of the storage table name and column names (version, executed\_at, execution\_time). The existing \TableMetadataStorage\ implementation has been updated to use these new types and configuration options, ensuring that migration execution metadata is stored and retrieved using the new structured models.

src/Metadata · high confidence

Removals

Removal of DoctrineExtensions Migrations component

The entire DoctrineExtensions Migrations component has been removed from the codebase. This includes the core migration classes (AbstractMigration, Migration, Version), configuration loaders (Configuration, XmlConfiguration, YamlConfiguration), CLI task implementations (DiffTask, ExecuteTask, GenerateTask, MigrateTask, StatusTask, VersionTask), and associated exception classes. Users can no longer use this library to manage database schema migrations via CLI or programmatic APIs.

lib/DoctrineExtensions · high confidence

Behavioural changes

Flattened exception class structure in Doctrine Migrations

The exception classes in the \src/Exception\ directory have been reorganized into a flat directory structure, moving all exception files directly under \src/Exception\ rather than nested subdirectories. This change affects the namespace and file paths for all migration-related exceptions (such as \AbortMigration\, \FrozenMigration\, and \UnknownMigrationVersion\), requiring updates to any code that directly references these exception classes by their previous hierarchical paths.

src/Exception · high confidence

Introduce lazy schema loading for DBAL migrations

The DBAL provider now supports lazy loading of the database schema during migration generation. A new \LazySchemaDiffProvider\ wraps the existing schema provider to defer the expensive \introspectSchema()\ call until the schema is actually needed, using native PHP 8.4 lazy objects when available or Symfony's VarExporter for earlier versions. This optimization reduces overhead for migrations that do not require a full schema comparison, while maintaining compatibility with the existing \DBALSchemaDiffProvider\ and \SchemaDiffProvider\ interfaces.

src/Provider · high confidence

Introduce new Version namespace for Doctrine Migrations core logic

The \src/Version\ directory has been restructured to contain the core classes for handling migration versions, including new interfaces and implementations for resolving version aliases (e.g., \first\, \current\, \latest\), calculating migration plans and status, comparing versions, and executing migrations via DBAL. This change introduces a dedicated \Version\ class and associated calculators (\MigrationPlanCalculator\, \MigrationStatusCalculator\) and executors (\DbalExecutor\) to manage the lifecycle and execution of database migrations.

src/Version · high confidence

Migrations framework refactored for DBAL 4.3 compatibility

The migration execution engine has been restructured to support DBAL 4.3, introducing a new \AbstractMigration\ base class that enforces a \freeze()\ mechanism to prevent SQL generation after migration execution begins. The core \DbalMigrator\ now relies on a dedicated \EventDispatcher\ and \Stopwatch\ for execution tracking and event handling, while the \DependencyFactory\ manages service wiring with a frozen-state check to prevent configuration changes post-initialization. Additionally, the \SchemaDumper\ now supports \--nowdoc\ output formatting and improved PCRE error handling, and the \Rollup\ functionality has been updated to work with the new metadata storage interfaces.

src · high confidence

New bin/doctrine-migrations entrypoint for Composer-installed usage

A new executable shell script at bin/doctrine-migrations has been added to serve as the primary entry point when the package is installed via Composer. This script delegates to bin/doctrine-migrations.php, which now explicitly searches for the Composer autoloader in standard locations (vendor/autoload.php and ../../../autoload.php) and initializes the ConsoleRunner with a dependency factory. This change allows users to run migrations directly via the bin script without needing the PHP extension in the command, provided the Composer dependencies are installed, while also adding a check to ensure the PHAR build includes dependencies if run in that mode.

bin · high confidence

Refactored migration generation with new generator classes and DBAL 4.5 compatibility

The migration generation logic in src/Generator has been restructured into dedicated classes: DiffGenerator handles schema comparison and migration creation, SqlGenerator produces the SQL method bodies (supporting nowdoc output for long queries), ConcatenationFileBuilder assembles migration files, and ClassNameGenerator creates versioned class names. This refactor introduces compatibility with DBAL 4.5 by using the new Schema editor API for dropping tables during asset filtering, and ensures correct handling of schema introspection differences.

src/Generator · high confidence

Reorganized CLI commands and added utility formatters

The console command classes have been moved into a new \src/Tools/Console/Command/\ directory structure, and the base \DoctrineCommand\ class now initializes a \ConsoleLogger\ for dependency injection. Two new utility classes, \BooleanStringFormatter\ and \BytesFormatter\, have been added to support configuration parsing and memory usage display. Additionally, the \DiffCommand\ and \DumpSchemaCommand\ now support \--nowdoc\ and \--no-nowdoc\ options to control SQL string formatting.

src/Tools · high confidence

Restructured configuration, event, and query components

The \src/Configuration\, \src/Event\, and \src/Query\ directories have been reorganized to improve modularity. Configuration loading is now handled by a dedicated \Configuration\ class and a suite of loaders (\ConfigurationLoader\, \ConnectionLoader\, \EntityManagerLoader\) that support multiple formats (JSON, PHP, XML, YAML) and sources (files, arrays, existing connections). Event handling has been refactored to use specific argument classes (\MigrationsEventArgs\, \MigrationsVersionEventArgs\) and includes a new \AutoCommitListener\ to manage transaction commits. The \Query\ component now encapsulates SQL statements with their parameters and types, including validation to ensure type counts do not exceed parameter counts.

src/Configuration, src/Event, src/Query · high confidence

Restructured migration finder with dedicated exception types

The migration finder component has been reorganized to improve code clarity and error handling. A new \FinderException\ interface and specific exception classes (\InvalidDirectory\, \NameIsReserved\) have been introduced to provide clearer error messages when loading migrations from invalid directories or encountering reserved names. The core \Finder\ abstract class and its implementations (\GlobFinder\, \RecursiveRegexFinder\) have been refactored to use these new exceptions, ensuring that users receive more descriptive feedback during migration discovery.

src/Finder · high confidence

Test coverage

Added test stubs for Doctrine Migrations; Added tests for Provider components; Added tests for Tools console commands and formatters; Added tests for configuration loading and defaults; Added tests for migration finder implementations; Added tests for multi-namespace migration discovery and query validation; Added unit tests for Generator components; Added unit tests for migration metadata and storage components; Added unit tests for the Version component; Migrate test suite to PHPUnit attributes and modernize test infrastructure.

Dependencies

Initial release of Doctrine Migrations 3.0 with PHP 8.1+ and modern dependency support

This entry introduces the Doctrine Migrations library (version 3.0) via a new composer.json manifest. It requires PHP 8.1 or higher and Composer runtime API 2, aligning with modern PHP standards. The library depends on Doctrine DBAL 3.6 or 4, Doctrine Event Manager 1.2 or 2, and Symfony Console/Stopwatch/VarExporter 5.4 through 8.0. Development dependencies include PHPUnit 10-12, PHPStan 2, and Doctrine Coding Standard 14, ensuring up-to-date testing and static analysis capabilities. The package is autoloaded via PSR-4 and provides a CLI binary at bin/doctrine-migrations.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 57.4 → 57.6 (+0.2)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 86.1 → 85.1 (-1.0)
  • Architecture 82.0 → 86.4 (+4.4)
  • Maturity 36.5 → 36.4 (-0.1)
  • Readiness 74.1 → 73.9 (-0.2)
  • Security 73.9 → 73.9 (0.0)

Resolved (12)

  • No ADRs found
  • Off-boarding risk: anonymized user #1
  • Orphaned files with no living knowledge
  • Projects may be oversized for their cohesion
  • Workflow token permissions not restricted (.github/workflows/bc-check.yml)
  • Workflow token permissions not restricted (.github/workflows/coding-standards.yml)
  • Workflow token permissions not restricted (.github/workflows/composer-lint.yml)
  • Workflow token permissions not restricted (.github/workflows/continuous-integration.yml)
  • Workflow token permissions not restricted (.github/workflows/documentation.yml)
  • Workflow token permissions not restricted (.github/workflows/release-on-milestone-closed.yml)
  • Workflow token permissions not restricted (.github/workflows/static-analysis.yml)
  • Workflow token permissions not restricted (.github/workflows/website-schema.yml)

New (22)

  • Circular dependency (src/DependencyFactory.php)
  • Concentrated knowledge decay
  • Edited copies of one member (3 members, 64+ corresponding lines) (src/Tools/Console/Command/ExecuteCommand.php)
  • Edited copy of a member (10 corresponding lines) (src/Tools/Console/Command/ListCommand.php)
  • Edited copy of a member (18 corresponding lines) (src/Tools/Console/Command/CurrentCommand.php)
  • Edited copy of a member (19 corresponding lines) (src/Configuration/Connection/ConfigurationFile.php)
  • Edited copy of a member (22 corresponding lines) (src/Configuration/Migration/JsonFile.php)
  • Edited copy of a member (6 corresponding lines) (src/Metadata/AvailableMigrationsList.php)
  • High: security finding (details withheld)
  • No ADRs found (composer.json)
  • Off the main sequence: src/Query
  • Orphaned file (src/DependencyFactory.php)
  • Orphaned file (src/Generator/Generator.php)
  • Orphaned file (src/SchemaDumper.php)
  • PR-triggered workflow without a permissions block (.github/workflows/bc-check.yml)
  • PR-triggered workflow without a permissions block (.github/workflows/coding-standards.yml)
  • PR-triggered workflow without a permissions block (.github/workflows/composer-lint.yml)
  • PR-triggered workflow without a permissions block (.github/workflows/documentation.yml)
  • PR-triggered workflow without a permissions block (.github/workflows/static-analysis.yml)
  • PR-triggered workflow without a permissions block (.github/workflows/website-schema.yml)
  • …and 2 more

Changes since last survey

  • 12 commits — 11 feature/other, 1 fixes

By area

  • (repo) — 6 commits
  • tests/Configuration — 3 commits
  • (root) — 1 commit
  • .github/workflows — 1 commit
  • docs/en — 1 commit

Notable commits

  • fix: Merge pull request #1613 from greg0ire/fix-build
  • change: Adapt test suite to DBAL 4.6
  • change: Bump the doctrine group with 6 updates
  • change: Drop assertions that never run
  • change: Fix typos in documentation
  • change: Merge pull request #1606 from doctrine/add-target-branch-check
  • change: Merge pull request #1607 from dylanpulver/drop-unreachable-assertions
  • change: Merge pull request #1609 from doctrine/dependabot/github_actions/doctrine-a96f73f10c
  • change: Merge pull request #1611 from hamidzr/fixtypos
  • change: Merge pull request #1617 from GromNaN/move-exception-expectations
  • change: Move exception expectations next to the throwing calls
  • change: Move remaining exception expectations next to the throwing calls

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

doctrine/migrations was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7467419c58c2b43dd8b6a493b05bac88cccfd1af — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.