- Home
- Database Migration Tools
- Doctrine Migrations
Doctrine Migrations
What it is
Doctrine Migrations is a free, self-hosted PHP library for versioning database schemas and managing changes in a way that can be reviewed and tested before production deployment. It builds on Doctrine DBAL and ORM, and can generate migration code by comparing a database schema with ORM mapping information. Its console tools let users check migration status, run dry runs, apply migrations and revert them. The `--write-sql` option saves generated SQL to a file rather than applying it directly, while `--no-interaction` supports runs without prompts. The documentation covers generating diffs with or without the ORM and using transactions or all-or-nothing transactions. Since schema changes can cause data loss, the migration command warns and requests confirmation by default. Install through Composer, which provides a `doctrine-migrations` console application in `vendor/bin`, or download a PHAR from GitHub releases. Doctrine lists integrations for Symfony, Zend, Laravel, Silex and Nette. Version 3.9.8 is marked stable; versions 3.8 and earlier are unmaintained. The repository identifies the project as MIT licensed.
For and against
For
- Generates migrations by comparing schemas and mappings.
- Supports dry runs, execution and reversion.
- Can write generated SQL to a file.
- Offers transaction controls and framework integrations.
Against
- Schema changes can result in data loss.
- Versions 3.8 and earlier are unmaintained.
- It is a PHP library built on Doctrine DBAL and ORM.
The verdict
Doctrine Migrations provides schema versioning and console controls for database change workflows. Its warning about potential data loss is important to account for before executing migrations.
Who it suits
Doctrine Migrations suits PHP developers managing database schema changes who want console-based controls for review, execution and rollback. It is particularly relevant to teams working with Doctrine DBAL or ORM and the listed framework integrations.
Plans and prices
Doctrine Migrations
Open-source PHP library · MIT license · Installed with Composer or downloaded as a PHAR
Read 8 Oct 2026 · github.com
On the record
- Automation
- The `--no-interaction` option allows migrations to run without additional prompts.doctrine-project.org · read 7 Oct 2026
- Command line
- A Composer installation provides a doctrine-migrations console application in vendor/bin.doctrine-project.org · read 8 Oct 2026
- Current stable version
- The project page lists version 3.9.8 as stable.doctrine-project.org · read 7 Oct 2026
- Database abstraction
- The project is built on top of Doctrine DBAL and ORM functionality.doctrine-project.org · read 8 Oct 2026
- Database integration
- The project builds on Doctrine DBAL and ORM.doctrine-project.org · read 7 Oct 2026
- Documentation support
- The documentation directs users to the Doctrine mailing list, Slack migrations channel, GitHub bug reports, and Stack Overflow for help.doctrine-project.org · read 7 Oct 2026
- Execution controls
- The documentation covers dry runs, executing one or multiple migrations, reverting migrations, and non-interactive execution.doctrine-project.org · read 8 Oct 2026
- Framework integrations
- The integrations guide lists community-built integrations for Symfony, Zend, Laravel, Silex, and Nette.doctrine-project.org · read 8 Oct 2026
- Installation
- The library can be installed with Composer or downloaded as a PHAR from GitHub releases.doctrine-project.org · read 8 Oct 2026
- Install options
- It can be installed with Composer or downloaded as a PHAR from GitHub releases.doctrine-project.org · read 7 Oct 2026
- Intended users
- The Doctrine Project describes its libraries as PHP libraries focused primarily on persistence services and related functionality.doctrine-project.org · read 7 Oct 2026
- License
- The GitHub repository identifies the project as MIT licensed.github.com · read 8 Oct 2026
- Migration controls
- Users can inspect migration status, run dry runs, execute migrations, and revert them from the console.doctrine-project.org · read 7 Oct 2026
- Purpose
- Doctrine Migrations adds database schema versioning and helps deploy schema changes.doctrine-project.org · read 8 Oct 2026
- Release status
- The project page marks version 3.9.8 as stable and versions 3.8 and earlier as unmaintained.doctrine-project.org · read 8 Oct 2026
- Review and testing
- The project says schema changes can be reviewed and tested before production deployment.doctrine-project.org · read 8 Oct 2026
- Risk note
- The migration command warns that schema changes can result in data loss and prompts for confirmation by default.doctrine-project.org · read 7 Oct 2026
- Schema comparison
- It can generate migrations by comparing the current database schema with mapping information defined through the ORM.doctrine-project.org · read 7 Oct 2026
The review
Overview
Doctrine Migrations is a free, MIT-licensed PHP library for versioning database schema changes, built on Doctrine DBAL and ORM. It suits PHP teams that want schema changes represented as code and controlled from the console. Its strongest case is a workflow that can compare mappings with a database, inspect and run changes, and prepare them for review before production.
Key features
Schema diffing can generate migrations from ORM mapping information, and documentation also covers generating them without the ORM. That flexibility makes the tool useful to Doctrine-based applications as well as projects that need migration generation without ORM mappings. Its code-based migration format gives teams a versioned artifact to review and test before deployment.
The console provides status inspection, dry runs, execution of one or multiple migrations, and rollback. Dry runs and the --write-sql option let teams inspect generated SQL before applying it; the latter writes SQL to a file rather than directly to the database. These controls help reduce surprises, but they do not eliminate the risk: the command warns that schema changes can cause data loss and asks for confirmation by default.
Documentation covers both all-or-nothing transactions and execution with or without transactions, allowing teams to choose behavior for their changes. The --no-interaction option supports automated runs without prompts, though unattended execution makes careful review of the migration and its transaction behavior especially important.
Install through Composer, which provides a doctrine-migrations console application in vendor/bin, or download a PHAR from GitHub releases. Version 3.9.8 is marked stable; versions 3.8 and earlier are unmaintained, so users should avoid building new workflows around those releases.
Pricing
Doctrine Migrations is free: its plan costs nothing and includes the open-source PHP library under the MIT license, installable through Composer or as a PHAR. There is no paid tier or trial to weigh against feature limits, and no seat or quota caps are stated. That makes it a straightforward fit for teams willing to manage the software in their own PHP environment; it is not a hosted migration service.
Platforms
Doctrine Migrations is available for Linux and self-hosted use. Its PHP focus makes it a natural fit for PHP applications, but the platform scope is narrower than tools that also name macOS or Windows support. Symfony users can add the separately packaged Doctrine Migrations Bundle; the integrations guide also lists community-built integrations for Zend, Laravel, Silex, and Nette.
Who it's for
Choose it if your team works in PHP and wants database changes managed as reviewable, testable migrations with console controls for status, dry runs, execution, and rollback. Doctrine users get a direct path from ORM mappings to generated migrations. Teams outside the PHP ecosystem, or those seeking a hosted service rather than a self-hosted library, should consider another tool.
Pros and cons
- Pros: ORM-based schema diffing can turn mapping changes into migration code, while a non-ORM diff path broadens its use beyond ORM projects.
- Pros: Dry runs, SQL file output, status inspection, and rollback give teams several ways to examine and control changes before and after execution.
- Pros: The MIT license and free plan avoid subscription costs, and Composer or PHAR installation offers two distribution paths.
- Cons: Schema changes can cause data loss; the default confirmation is a useful warning, not a substitute for review and testing.
- Cons: It is a PHP-focused, Linux and self-hosted option, so it is a less direct fit for teams using other ecosystems or seeking a hosted interface.
Alternatives
For a wider comparison, see Database Migration Tools. Consider Skeema if you want a freemium option with a free Community plan covering tables, stored procedures and functions, and 18 linter checks on Linux and macOS. Sqitch is another free database change management application, with Linux, macOS, Windows, and self-hosted support.
sqlx-cli may suit readers seeking a free tool that combines migrations with offline query metadata. Atlas is an alternative for those looking at an open-core model, with an Apache 2.0 core and advanced features. For a web-based option, Bytebase Enterprise has a free Community plan for up to 20 users and 10 database instances, as well as a paid Pro plan.
db-migrate is a free, MIT-licensed migration tool for teams working with Node.js 24 or newer, with database drivers installed separately. dbmate is a free open-source migration tool without a stated paid SaaS upsell. FluentMigrator is a free Apache-2.0 framework distributed through NuGet, with provider packages selected separately.
Verdict
Doctrine Migrations is a strong choice for PHP teams that want free, code-based schema versioning and practical console controls, especially when Doctrine ORM mappings can drive migration generation. Its review and rollback tools make controlled change workflows possible, but the data-loss warning deserves serious attention. Look elsewhere if you need a hosted service or a tool aimed at a different development ecosystem.