Share via


Migration Class

Definition

A base class inherited by each EF Core migration.

public abstract class Migration
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class Migration
type Migration = class
[<System.Runtime.CompilerServices.Nullable(0)>]
type Migration = class
Public MustInherit Class Migration
Inheritance
Migration
Attributes

Remarks

See Database migrations for more information and examples.

Constructors

Name Description
Migration()

Creates a Migration instance.

Fields

Name Description
InitialDatabase

The migration identifier for the empty database.

Properties

Name Description
ActiveProvider

The name of the current database provider.

DownOperations

The MigrationOperations that will migrate the database 'down'.

TargetModel

The IModel that the database will map to after the migration has been applied.

UpOperations

The MigrationOperations that will migrate the database 'up'.

Methods

Name Description
BuildTargetModel(ModelBuilder)

Implemented to build the TargetModel.

Down(MigrationBuilder)

Builds the operations that will migrate the database 'down'.

Up(MigrationBuilder)

Builds the operations that will migrate the database 'up'.

Applies to