DbMigrator DbMigrator DbMigrator Class


DbMigrator is used to apply existing migrations to a database. DbMigrator can be used to upgrade and downgrade to any given migration. To scaffold migrations based on changes to your model use MigrationScaffolder

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
public class DbMigrator : System.Data.Entity.Migrations.Infrastructure.MigratorBase
type DbMigrator = class
    inherit MigratorBase
Public Class DbMigrator
Inherits MigratorBase


DbMigrator(DbMigrationsConfiguration) DbMigrator(DbMigrationsConfiguration) DbMigrator(DbMigrationsConfiguration)

Initializes a new instance of the DbMigrator class.


InitialDatabase InitialDatabase InitialDatabase

Migration Id representing the state of the database before any migrations are applied.


Configuration Configuration Configuration

Gets the configuration that is being used for the migration process.


GetDatabaseMigrations() GetDatabaseMigrations() GetDatabaseMigrations()

Gets all migrations that have been applied to the target database.

GetLocalMigrations() GetLocalMigrations() GetLocalMigrations()

Gets all migrations that are defined in the configured migrations assembly.

GetPendingMigrations() GetPendingMigrations() GetPendingMigrations()

Gets all migrations that are defined in the assembly but haven't been applied to the target database.

Update() Update() Update()

Updates the target database to the latest migration.

(Inherited from MigratorBase)
Update(String) Update(String) Update(String)

Updates the target database to a given migration.

Applies to