| name | migrate |
| description | Guided, safe migration workflow covering EF Core schema migrations, .NET version upgrades, and NuGet dependency updates — each with rollback strategies and verification steps. Invoke when: "add migration", "update database", "create migration", "schema change", "new table", "rename column", "upgrade nuget", "update packages", "dependency update", "version upgrade", ".NET upgrade".
|
/migrate
What
The single migration workflow for three change types, with EF Core schema
migrations as the primary flow:
- EF Core schema — review pending model changes, generate a descriptively
named migration, review the SQL for data loss and locking risks, apply with
a documented rollback path.
- .NET version upgrade — phased TFM/SDK/package upgrade with verification
at each phase.
- NuGet updates — incremental, one-package-at-a-time updates so breakage
is always attributable.
Shared principles: verify before applying, rollback plan always, test after
every step, one logical change per migration.
When
- After modifying entity classes, DbContext configuration, or relationships
- "add migration", "update database", "create migration", "new table", "rename column"
- When generating SQL scripts for DBA review
- "upgrade to .NET 10", "version upgrade", ".NET upgrade"
- "upgrade nuget", "update packages", "dependency update", vulnerable package alerts
How
First, classify the request: schema change → Flow A; framework upgrade → Flow B;
package update → Flow C. Then follow that flow end to end.
Flow A: EF Core Schema Migration (primary)
Step 1: Assess current state
dotnet ef migrations list --project <InfraProject> --startup-project <ApiProject>
Check for pending migrations and uncaptured model changes.
Step 2: Review model changes