I need to apply Entity Framework Core migrations one by one in code, i can call the
await dbContext.Database.MigrateAsync(); but it applies all the pending migrations in one block.
Is there an extension or other method to apply the migrations just one by one or selecting the name of the migration to apply?
There is a IMigrator service with a
Migrate(string targetMigration) method that receives the migration name, this method is used by the
From a DbContext instance it can be used as:
The pending migrations names can be queried by this extension:
var pending = dbContext.Database.GetPendingMigrations();