Share via


DbMigrator Class

Definition

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

public class DbMigrator : System.Data.Entity.Migrations.Infrastructure.MigratorBase
[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
Inheritance
DbMigrator
Attributes

Constructors

Name Description
DbMigrator(DbMigrationsConfiguration)

Initializes a new instance of the DbMigrator class.

Fields

Name Description
InitialDatabase

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

Properties

Name Description
Configuration

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

Methods

Name Description
GetDatabaseMigrations()

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

GetLocalMigrations()

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

GetPendingMigrations()

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

Update()

Updates the target database to the latest migration.

(Inherited from MigratorBase)
Update(String)

Updates the target database to a given migration.

Applies to