Share via


DbMigration Class

Definition

Base class for code-based migrations.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

public abstract class DbMigration : System.Data.Entity.Migrations.Infrastructure.IDbMigration
type DbMigration = class
    interface IDbMigration
Public MustInherit Class DbMigration
Implements IDbMigration
Inheritance
DbMigration
Implements

Constructors

DbMigration()

Methods

AddColumn(String, String, Func<ColumnBuilder,ColumnModel>, Object)

Adds an operation to add a column to an existing table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AddForeignKey(String, String, String, String, Boolean, String, Object)

Adds an operation to create a new foreign key constraint.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AddForeignKey(String, String[], String, String[], Boolean, String, Object)

Adds an operation to create a new foreign key constraint.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AddPrimaryKey(String, String, String, Boolean, Object)

Adds an operation to create a new primary key.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AddPrimaryKey(String, String, String, Object)

Adds an operation to create a new primary key.

AddPrimaryKey(String, String[], String, Boolean, Object)

Adds an operation to create a new primary key based on multiple columns.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AddPrimaryKey(String, String[], String, Object)

Adds an operation to create a new primary key based on multiple columns.

AlterColumn(String, String, Func<ColumnBuilder,ColumnModel>, Object)

Adds an operation to alter the definition of an existing column.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AlterStoredProcedure(String, String, Object)

Adds an operation to alter a stored procedure.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AlterStoredProcedure<TParameters>(String, Func<ParameterBuilder,TParameters>, String, Object)

Adds an operation to alter a stored procedure.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

AlterTableAnnotations<TColumns>(String, Func<ColumnBuilder,TColumns>, IDictionary<String,AnnotationValues>, Object)

Adds an operation to handle changes in the annotations defined on tables.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateIndex(String, String, Boolean, String, Boolean, Object)

Adds an operation to create an index on a single column.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateIndex(String, String, Boolean, String, Object)

Adds an operation to create an index on a single column.

CreateIndex(String, String[], Boolean, String, Boolean, Object)

Adds an operation to create an index on multiple columns.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateIndex(String, String[], Boolean, String, Object)

Adds an operation to create an index on multiple columns.

CreateStoredProcedure(String, String, Object)

Adds an operation to create a new stored procedure.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateStoredProcedure<TParameters>(String, Func<ParameterBuilder,TParameters>, String, Object)

Adds an operation to create a new stored procedure.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateTable<TColumns>(String, Func<ColumnBuilder,TColumns>, IDictionary<String,Object>, Object)

Adds an operation to create a new table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

CreateTable<TColumns>(String, Func<ColumnBuilder,TColumns>, Object)

Adds an operation to create a new table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

Down()

Operations to be performed during the downgrade process.

DropColumn(String, String, IDictionary<String,Object>, Object)

Adds an operation to drop an existing column.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropColumn(String, String, Object)

Adds an operation to drop an existing column.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropForeignKey(String, String, Object)

Adds an operation to drop a foreign key constraint based on its name.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropForeignKey(String, String, String, Object)

Adds an operation to drop a foreign key constraint based on the column it targets.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropForeignKey(String, String, String, String, Object)
Obsolete.

Adds an operation to drop a foreign key constraint based on the column it targets.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropForeignKey(String, String[], String, Object)

Adds an operation to drop a foreign key constraint based on the columns it targets.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropIndex(String, String, Object)

Adds an operation to drop an index based on its name.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropIndex(String, String[], Object)

Adds an operation to drop an index based on the columns it targets.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropPrimaryKey(String, Object)

Adds an operation to drop an existing primary key that was created with the default name.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropPrimaryKey(String, String, Object)

Adds an operation to drop an existing primary key that does not have the default name.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropStoredProcedure(String, Object)

Adds an operation to drop an existing stored procedure with the specified name.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropTable(String, IDictionary<String,IDictionary<String,Object>>, Object)

Adds an operation to drop a table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropTable(String, IDictionary<String,Object>, IDictionary<String,IDictionary<String,Object>>, Object)

Adds an operation to drop a table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropTable(String, IDictionary<String,Object>, Object)

Adds an operation to drop a table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

DropTable(String, Object)

Adds an operation to drop a table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

GetType()

Gets the Type of the current instance.

MemberwiseClone()

Creates a shallow copy of the current Object.

MoveStoredProcedure(String, String, Object)

Adds an operation to move a stored procedure to a new schema.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

MoveTable(String, String, Object)

Adds an operation to move a table to a new schema.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

RenameColumn(String, String, String, Object)

Adds an operation to rename a column.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

RenameIndex(String, String, String, Object)

Adds an operation to rename an index.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

RenameStoredProcedure(String, String, Object)

Adds an operation to rename a stored procedure. To change the schema of a stored procedure use MoveStoredProcedure

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

RenameTable(String, String, Object)

Adds an operation to rename a table. To change the schema of a table use MoveTable.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

Sql(String, Boolean, Object)

Adds an operation to execute a SQL command or set of SQL commands.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

SqlFile(String, Boolean, Object)

Adds an operation to execute a SQL file.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

SqlResource(String, Assembly, Boolean, Object)

Adds an operation to execute a SQL resource file.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

ToString()

Returns a string that represents the current object.

Up()

Operations to be performed during the upgrade process.

Explicit Interface Implementations

IDbMigration.AddOperation(MigrationOperation)

Adds a custom MigrationOperation to the migration. Custom operation implementors are encouraged to create extension methods on IDbMigration that provide a fluent-style API for adding new operations.

Applies to