home / skills / makfly / superpowers-symfony / doctrine-migrations
This skill helps manage Symfony Doctrine migrations safely, optimizing integrity and performance during schema evolution.
npx playbooks add skill makfly/superpowers-symfony --skill doctrine-migrationsReview the files below or copy the command above to add this skill to your agents.
---
name: symfony:doctrine-migrations
allowed-tools:
- Read
- Write
- Edit
- Bash
- Glob
- Grep
description: Evolve Symfony Doctrine models and schema safely with integrity, performance, and rollout discipline. Use for doctrine migrations tasks.
---
# Doctrine Migrations (Symfony)
## Use when
- Designing entity relations or schema evolution.
- Improving Doctrine correctness/performance.
## Default workflow
1. Model ownership/cardinality and transactional boundaries.
2. Apply mapping/schema changes with migration safety.
2. Tune fetch/query behavior for hot paths.
2. Verify lifecycle behavior with targeted tests.
## Guardrails
- Keep owning/inverse sides coherent.
- Avoid destructive migration jumps in one release.
- Eliminate accidental N+1 and over-fetching.
## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
## Output contract
- Entity/migration changes.
- Integrity and performance decisions.
- Validation outcomes and rollback notes.
## References
- `reference.md`
- `docs/complexity-tiers.md`
This skill helps evolve Symfony Doctrine models and database schema with an emphasis on data integrity, performance, and disciplined rollout. It guides mapping changes, migration generation, and verification steps to avoid common pitfalls like N+1 queries or destructive schema jumps. Use it to apply safe, testable schema evolution in production systems.
The skill inspects entity mappings, transactional boundaries, and query hotspots to recommend migration strategies and mapping adjustments. It generates or validates migration plans that preserve data integrity and minimize downtime, and it suggests fetch and indexing changes for performance-sensitive paths. Outputs include proposed entity/migration changes, integrity decisions, validation results, and rollback notes.
How do I avoid destructive schema changes in a single release?
Break the change into multiple migrations: add new columns, backfill data, switch reads/writes to the new shape, then drop old columns in a later release.
What should I test before deploying migrations?
Run migration dry-runs, data integrity checks, query performance tests for hot paths, and automated tests that exercise affected lifecycle callbacks.