Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dotnet avatar

Migrations

  • 1 installs
  • 14.8k repo stars
  • Updated August 4, 2026
  • dotnet/efcore

Implementation-detail guide for EF Core's migrations internals, for contributors changing MigrationsSqlGenerator, model diffing, operations, or the Migrator.

About

A contributor-facing skill documenting the EF Core migrations pipeline, model snapshot format, and test locations. A developer uses it when modifying EF Core's migration scaffolding, SQL generation, or model-differ code.

  • Maps the add-migration and apply-migration pipelines end to end
  • Notes model snapshots use property-bag Dictionary types, not real CLR types

Migrations by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #121 of 153 .NET & C# skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dotnet/efcore --skill migrations

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars14.8k
Last updatedAugust 4, 2026
Repositorydotnet/efcore

What it does

Implementation-detail guide for EF Core's migrations internals, for contributors changing MigrationsSqlGenerator, model diffing, operations, or the Migrator.

Files

SKILL.mdMarkdownGitHub ↗

Migrations

Pipeline

Add migration: MigrationsScaffolder.ScaffoldMigration()MigrationsModelDiffer.GetDifferences() → list of MigrationOperationCSharpMigrationsGenerator and CSharpSnapshotGenerator produce Up/Down/Snapshot code

Apply migration: Migrator.MigrateAsync() → reads __EFMigrationsHistory → per pending: MigrationsSqlGenerator.Generate(operations)MigrationCommandExecutor executes

Model Snapshot

  • Model snapshots use typeof(Dictionary<string, object>) (property bag format), not the actual CLR type. When examining the ClrType in a snapshot, don't assume it matches the real entity type.
  • SnapshotModelProcessor.Process() is used at design-time to fixup older model snapshots for backward compatibility.

Testing

Migration operation tests: test/EFCore.Relational.Tests/Migrations/. Functional tests: test/EFCore.{Provider}.FunctionalTests/Migrations/. Model differ tests: test/EFCore.Relational.Tests/Migrations/Internal/MigrationsModelDifferTest*.cs.

Related skills

.NET & C#databases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.