Loading...
Loading...
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".
npx skill4agent add codewithmukesh/dotnet-claude-kit migratedotnet ef migrations list --project <InfraProject> --startup-project <ApiProject>find_symbol(name: entity or DbSet) -- locate the changed entity
get_type_hierarchy(typeName: entity) -- check TPH/TPT/TPC inheritance changes
find_references(symbolName: property) -- assess downstream query impactAdd|Remove|Rename|ModifyWhatChanged# GOOD
dotnet ef migrations add AddOrderShippingAddress --project <Infra> --startup-project <Api>
# BAD — names the entity, not the change
dotnet ef migrations add Orderdatabase updatedotnet ef migrations script --idempotent --project <Infra> --startup-project <Api>protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>("ContactEmail", "Customers", nullable: true);
migrationBuilder.Sql("UPDATE \"Customers\" SET \"ContactEmail\" = \"Email\"");
migrationBuilder.AlterColumn<string>("ContactEmail", "Customers", nullable: false);
migrationBuilder.DropColumn("Email", "Customers");
}dotnet ef database update --project <Infra> --startup-project <Api>
dotnet build && dotnet test # integration tests catch schema mismatchesdotnet ef database update <PreviousMigrationName> --project <Infra> --startup-project <Api>
dotnet ef migrations remove --project <Infra> --startup-project <Api> # if unapplying from codeget_project_graphglobal.json"rollForward": "latestMinor"<TargetFramework>net10.0</TargetFramework><LangVersion>14</LangVersion>.csprojDirectory.Build.propsdotnet outdated --upgrade Major --include Microsoft.*knowledge/dotnet-whats-new.mdTimeProviderHybridCachedotnet builddotnet testdotnet format --verify-no-changesdotnet list package --outdateddotnet list package --vulnerabledotnet build && dotnet testknowledge/package-recommendations.mdknowledge/mediatr-to-mediator-migration.mdfind_symbolfind_referencesget_type_hierarchyget_project_graphget_diagnosticsUser: /migrate
Claude: Checking migration state...
Last applied: 20250710_AddOrderTable
Model changes detected: new ShippingAddress property on Order entity.
Creating migration: AddOrderShippingAddress
Reviewing SQL (dotnet ef migrations script --idempotent)...
- ALTER TABLE "Orders" ADD "ShippingStreet" text NULL
- ALTER TABLE "Orders" ADD "ShippingCity" text NULL
No data loss. No locking risk. Safe to apply.
Applying migration... Done. Build: green. Tests: 34/34 passed.
Rollback (if needed):
dotnet ef database update AddOrderTable --project src/Infrastructure --startup-project src/Apief-core/verify/checkpoint