CtrlK
BlogDocsLog inGet started
Tessl Logo

migrations

Implementation details for EF Core migrations. Use when changing MigrationsSqlGenerator, model diffing, migration operations, HistoryRepository, the Migrator or related classes.

80

Quality

100%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

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.

Repository
dotnet/efcore
Last updated
First committed

Also appears in

dotnet/dotnet
In sync

since Jul 28, 2026

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.