migration

Creates and applies Entity Framework Core database migrations via dotnet CLI commands.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/gmolike/Claude-Template --skill migration-gmolike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration
Source: https://github.com/gmolike/Claude-Template/tree/main/template-backend-dotnet/.claude/skills/migration
Command: npx skills add https://github.com/gmolike/Claude-Template --skill migration-gmolike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually writing and applying database schema changes in a .NET backend is error-prone and repetitive. This Skill automates the creation and application of EF Core migrations so schema changes stay consistent with your data model. ## Core Features & Use Cases - Migration Generation: Runs dotnet ef migrations add against the Infrastructure project with the API project as startup project. - Migration Review: Prompts verification of the generated migration files in Persistence/Migrations/ before applying them. - Database Update: Applies pending migrations with dotnet ef database update to keep the database schema in sync. - Use Case: After adding a new entity or changing a model in your .NET backend, invoke the skill with a migration name to scaffold and apply the schema change in one guided flow. ## Quick Start Ask the assistant to create and apply an EF Core migration named AddUserTable using the migration skill.

Frequently Asked Questions about migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an EF Core migration from the command line?

Run dotnet ef migrations add followed by the migration name, specifying the project containing the DbContext and the startup project. This scaffolds migration files into the Migrations folder for review.

How do I apply EF Core migrations to the database?

Run dotnet ef database update with the Infrastructure project and startup project specified. This applies all pending migrations to the configured database connection.

Why does dotnet ef require a startup project flag?

The startup project provides the configuration and connection string needed to build the DbContext at design time. When the DbContext lives in a separate Infrastructure project, the API project must be passed as startup project.

What should I check before applying a generated EF Core migration?

Review the generated files in Persistence/Migrations to confirm the Up and Down operations match the intended schema change. Incorrect model configurations can produce destructive operations like dropped columns.

What are the limitations of EF Core migrations?

EF Core migrations cannot express every database operation, such as complex data transformations or custom stored procedures. Those cases require editing the migration manually with raw SQL via migrationBuilder.Sql.