entity-framework-core

Get-Migrations in EF Core


This might be a stupid question, but it does seem the EF Core doesn't have the Get-Migrations command. Was it replaced anyhow or did MS just decide it is not needed?


Solution

  • It seems you're correct: Get-Migrations doesn't seem to be available in Entity Framework Core.

    As an alternative, maybe you can use __EFMigrationsHistory:

    https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/history-table

    By default, EF Core keeps track of which migrations have been applied to the database by recording them in a table named __EFMigrationsHistory.