Skip to main content
skill CX Codex

doctrine-migrations — Claude Code skill for Doctrine migrations

Create and review Doctrine migrations, prepare rollbacks, and check pending changes before deployment. Useful when a Symfony app’s entity mapping changes.

MIT ★ 234 updated 2026-10-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-code
Open on GitHub

What doctrine-migrations does

The skill guides migration work from a mapping change to execution. It uses make:migration or doctrine:migrations:diff to generate a file, then calls for reviewing each SQL statement and making sure down() reverses up(). It also covers checking migration status and running a dry run before applying changes.

For reversals, it describes doctrine:migrations:migrate prev and doctrine:migrations:execute --down. With multiple entity managers, pass --em to each migration command. Never modify a migration that has already been applied; create another one instead. Keep data changes separate from schema diffs.

all_or_nothing is mostly effective on PostgreSQL. Most MySQL DDL commits implicitly, so that setting does not provide the same group rollback there. The skill guides the developer through review and execution, but production SQL still needs to be checked before it runs.

What it helps with

  • generate a migration after changing entity mapping
  • inspect SQL produced by a migration diff
  • write a down() method that reverses up()
  • check pending migrations before applying them
  • prepare a rollback command for a deployed version

Example prompts for the agent

  • Create a Doctrine migration for the new field in my entity mapping.
  • Review this migration for a column drop-and-add and verify that down() reverses up().
  • Check migration status, run a dry run, and prepare the production rollback command.

How to install doctrine-migrations

1Skills CLI (Vercel)

npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-code

2Manually: put the files in place

~/.claude/skills/doctrine-migrations/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/doctrine-migrations/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about doctrine-migrations

How do I install doctrine-migrations in Claude Code?

Run npx skills add dev-toolings/superpowers-symfony --skill doctrine-migrations -a claude-code. The skill file is at ~/.claude/skills/doctrine-migrations/SKILL.md.

What does the doctrine-migrations skill do?

It guides the creation and review of Doctrine migration files, including SQL checks and rollback logic. It also covers status checks and dry runs before applying migrations.

How does the skill handle multiple entity managers and MySQL?

It advises passing --em to every migration command when several entity managers are involved. all_or_nothing is mostly effective on PostgreSQL because MySQL often commits DDL implicitly.

Source text

SKILL.md · MIT
---
name: doctrine-migrations
description: Create and manage Doctrine migrations (bundle 4.x, library 3.9) for schema versioning; handle dependencies, rollbacks, and production deployment
capabilities: [read, search, edit, shell]
tags: [doctrine]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash
---

# Doctrine Migrations (Symfony)

## Use when
- A mapping change needs a schema migration (new column, index or table).
- Reviewing a generated `make:migration` or `doctrine:migrations:diff` file before it is applied.
- Rolling back a version, or deploying pending migrations to production.
- Tuning `doctrine_migrations.yaml` (`transactional`, `all_or_nothing`, `enable_service_migrations`).

## Default workflow
1. Change the entity mapping, then generate the migration with `make:migration` or `doctrine:migrations:diff`.
2. Read every `addSql()` line: a rename can appear as drop plus add, and index churn is common.
3. Write a real `down()` that reverses `up()`, and keep one concern per migration.
4. Check `doctrine:migrations:status`, preview with `doctrine:migrations:migrate --dry-run`, then run `doctrine:migrations:migrate`.
5. Roll back with `doctrine:migrations:migrate prev` or `doctrine:migrations:execute` with `--down`.
6. With several entity managers, pass `--em` to every migrations command.

## Guardrails
- Never edit an already-applied migration: add a new one.
- Keep diff-generated migrations schema only; put data changes in a dedicated, idempotent migration or command.
- Keep the typed signatures `up(Schema $schema): void` and `down(Schema $schema): void`.
- `all_or_nothing` is mostly effective on PostgreSQL, since most MySQL DDL commits implicitly.

## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.

## Output contract
- Migration files with a reviewed `up()` and a working `down()`.
- Output of `doctrine:migrations:status` and the dry-run, plus the rollback command.
- Any `doctrine_migrations.yaml` change and why.

## References
- `reference.md`

© dev-toolings · MIT · dev-toolings/superpowers-symfony

Similar skills

All skills for Data and databases →
database-migrations affaan-m database-migrations is a Claude Code skill for schema and data migrations, rollback planning, and zero-downtime changes. It activates for work such as adding a column or index to a large table. CX Codex +1 7,200installs managed-airflow-migrations official google managed-airflow-migrations guides Airflow DAG migrations for Managed Service for Apache Airflow to Airflow 2.11.1 or Airflow 3. Use it for code upgrades, not unrelated DAG run failures. CX Codex +1 4,200installs convex-migrations waynesutton convex-migrations walks a live Convex schema change through six steps: optional field, batched backfill, validator flip, cleanup. Useful when npx convex dev rejects existing documents. CX Codex +1 2,600installs drizzle-migrations bobmatnyc drizzle-migrations — a skill that puts SQL migrations first in TypeScript projects on Drizzle ORM. Useful when the same schema has to hold across several environments. CX Codex +1 1,300installs 313-frameworks-spring-db-migrations-flyway Juan Antonio Breña Moral 313-frameworks-spring-db-migrations-flyway — a skill for adding and reviewing Flyway migrations in Spring Boot: Maven dependencies, db/migration scripts, spring.flyway.* settings and migration ordering. CX Codex +1 389installs drizzle-safe-migrations Pedro Nauck drizzle-safe-migrations plans safe Drizzle migrations: data backfills, enum/check/default tightening, migration ordering, and rollback. Use it when a schema change touches existing rows. CX Codex +1 348installs

From the same set51

The whole set →
symfony-scheduler Configures recurring tasks with the Symfony Scheduler component without system crontab entries. Useful for scheduled report generation, database cleanups, and Messenger syncs. CX Codex +1 ★ 234repo stars tdd-with-pest tdd-with-pest guides RED-GREEN-REFACTOR in Symfony projects using Pest v4. Use it to write new tests, reproduce bugs before a fix, or move PHPUnit tests to Pest syntax. CX Codex +1 ★ 234repo stars api-platform-versioning api-platform-versioning keeps API Platform clients alive through renames and removals: deprecation with a sunset date first, parallel versions as the last resort. CX Codex +1 ★ 234repo stars functional-tests functional-tests guides Claude Code in writing functional Symfony tests using WebTestCase, KernelTestCase, loginUser, and DAMA rollback. CX Codex +1 ★ 234repo stars symfony-messenger A skill for async message handling with Symfony Messenger: configures transports, handlers, and retry strategies. CX Codex +1 ★ 234repo stars api-platform-security api-platform-security secures API Platform operations with security expressions, voters, and validation-phase access checks in Symfony. CX Codex +1 ★ 234repo stars e2e-panther-playwright The e2e-panther-playwright skill guides Symfony E2E tests with Panther for browser flows and Playwright for more involved cases. Use it when JavaScript behavior is beyond what WebTestCase can observe. CX Codex +1 ★ 234repo stars doctrine-relations Skill guides you through defining Doctrine relationships (OneToMany, ManyToMany, ManyToOne) with correct owning and inverse sides, cascade strategies, and N+1 query prevention. CX Codex +1 ★ 234repo stars

Project sponsors

Companies that keep this analytics open