whatisgithub

What is migrations?

doctrine/migrations — explained in plain English

Analysis updated 2026-06-26

4,776PHPAudience · developerComplexity · 3/5Setup · moderate

In one sentence

Doctrine Migrations is a PHP library that tracks database schema changes as versioned PHP class files, letting you apply or reverse them in order so every environment stays in sync.

Mindmap

mindmap
  root((migrations))
    What It Does
      Version schema changes
      Apply migrations in order
      Roll back changes
      Sync environments
    Tech Stack
      PHP
      Composer
      Doctrine DBAL
      Symfony
    Use Cases
      Add columns or tables
      Sync dev and production
      Automate schema updates
    Audience
      PHP developers
      Symfony teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Write a migration class to add a new column to an existing database table without breaking production data.

USE CASE 2

Roll back a failed schema change on a staging server by calling the migration down method.

USE CASE 3

Keep a development machine, staging server, and production database in sync by committing migration files to version control.

What is it built with?

PHPComposerDoctrine DBALSymfony

How does it compare?

doctrine/migrationsendroid/qr-codecorcel/corcel
Stars4,7764,7764,779
LanguagePHPPHPPHP
Setup difficultymoderateeasymoderate
Complexity3/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Doctrine DBAL and a configured database connection, most commonly used inside Symfony but also works in standalone PHP projects.

So what is it?

Doctrine Migrations is a PHP library for managing database schema changes in a controlled, versioned way. It is part of the broader Doctrine project, which provides database tools for PHP applications, and it works closely with Doctrine DBAL, the database abstraction layer that many PHP frameworks use under the hood. When you build an application that writes data to a relational database, the structure of that database rarely stays fixed. You add a table for a new feature, rename a column, add an index to speed up a slow query, or drop a field that is no longer needed. Without a migration system, keeping those changes consistent across a development machine, a staging server, and a production database is error-prone. A developer might apply a change locally and forget to document it, leaving the production database out of sync. Doctrine Migrations solves this by letting you write each schema change as a PHP class, stored as a timestamped file in version control. Each migration class has an up method that applies the change and a down method that reverses it. A command-line tool reads the database, compares what has been applied against what exists in the codebase, and runs only the missing steps in order. That way every environment can reach the same schema by running the same sequence of files. The library is widely used in projects built on the Symfony PHP framework, though it works with any PHP application that uses Doctrine DBAL. Configuration, command references, and usage examples live in the external documentation linked from the repository. The README itself is minimal and points there directly.

Copy-paste prompts

Prompt 1
Using Doctrine Migrations in a Symfony project, generate a migration class that adds a last_login timestamp column to the users table.
Prompt 2
How do I run only the pending Doctrine Migrations against a Symfony app without re-running already-applied ones?
Prompt 3
Show me how to write a Doctrine Migrations class with an up method that creates a new orders table and a down method that drops it safely.
Prompt 4
How do I configure Doctrine Migrations to connect to a PostgreSQL database instead of MySQL in a standalone PHP project without Symfony?

Frequently asked questions

What is migrations?

Doctrine Migrations is a PHP library that tracks database schema changes as versioned PHP class files, letting you apply or reverse them in order so every environment stays in sync.

What language is migrations written in?

Mainly PHP. The stack also includes PHP, Composer, Doctrine DBAL.

How hard is migrations to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is migrations for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.