Partilhar via


MigrationBuilder Class

Definition

A builder providing a fluent-like API for building MigrationOperations.

public class MigrationBuilder
type MigrationBuilder = class
Public Class MigrationBuilder
Inheritance
MigrationBuilder

Remarks

See Database migrations for more information and examples.

Constructors

MigrationBuilder(String)

Creates a new instance of the builder.

Properties

ActiveProvider

The name of the database provider being used.

Operations

The list of MigrationOperations being built.

Methods

AddCheckConstraint(String, String, String, String)

Builds an AddCheckConstraintOperation to add a new check constraint to a table.

AddColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>, String, String, Nullable<Int32>, Nullable<Int32>, Nullable<Boolean>)

Builds an AddColumnOperation to add a new column to a table.

AddColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>, String)

Builds an AddColumnOperation to add a new column to a table.

AddColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>)

Builds an AddColumnOperation to add a new column to a table.

AddColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String)

Builds an AddColumnOperation to add a new column to a table.

AddForeignKey(String, String, String, String, String, String, String, ReferentialAction, ReferentialAction)

Builds an AddForeignKeyOperation to add a new foreign key to a table.

AddForeignKey(String, String, String[], String, String, String, String[], ReferentialAction, ReferentialAction)

Builds an AddForeignKeyOperation to add a new composite (multi-column) foreign key to a table.

AddPrimaryKey(String, String, String, String)

Builds an AddPrimaryKeyOperation to add a new primary key to a table.

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

Builds an AddPrimaryKeyOperation to add a new composite (multi-column) primary key to a table.

AddUniqueConstraint(String, String, String, String)

Builds an AddUniqueConstraintOperation to add a new unique constraint to a table.

AddUniqueConstraint(String, String, String[], String)

Builds an AddUniqueConstraintOperation to add a new composite (multi-column) unique constraint to a table.

AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>)

Builds an AlterColumnOperation to alter an existing column.

AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>, String, String)

Builds an AlterColumnOperation to alter an existing column.

AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>)

Builds an AlterColumnOperation to alter an existing column.

AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String)

Builds an AlterColumnOperation to alter an existing column.

AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String)
AlterDatabase()

Builds an AlterDatabaseOperation to alter an existing database.

AlterDatabase(String, String)

Builds an AlterDatabaseOperation to alter an existing database.

AlterSequence(String, String, Int32, Nullable<Int64>, Nullable<Int64>, Boolean, Int32, Nullable<Int64>, Nullable<Int64>, Boolean)

Builds an AlterSequenceOperation to alter an existing sequence.

AlterSequence(String, String, Int32, Nullable<Int64>, Nullable<Int64>, Boolean)
AlterTable(String, String, String, String)

Builds an AlterTableOperation to alter an existing table.

AlterTable(String, String)

Builds an AlterTableOperation to alter an existing table.

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

Builds a CreateIndexOperation to create a new index.

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

Builds a CreateIndexOperation to create a new index.

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

Builds a CreateIndexOperation to create a new composite (multi-column) index.

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

Builds a CreateIndexOperation to create a new composite (multi-column) index.

CreateIndex(String, String, String[], String, Boolean)
CreateSequence(String, String, Int64, Int32, Nullable<Int64>, Nullable<Int64>, Boolean)

Builds a CreateSequenceOperation to create a new sequence.

CreateSequence<T>(String, String, Int64, Int32, Nullable<Int64>, Nullable<Int64>, Boolean)

Builds a CreateSequenceOperation to create a new sequence.

CreateTable<TColumns>(String, Func<ColumnsBuilder,TColumns>, String, Action<CreateTableBuilder<TColumns>>, String)

Builds a CreateTableOperation to create a new table.

CreateTable<TColumns>(String, Func<ColumnsBuilder,TColumns>, String, Action<CreateTableBuilder<TColumns>>)

Builds an CreateTableOperation to create a new table.

DeleteData(String, String, Object, String)

Builds a DeleteDataOperation to delete a single row of seed data.

DeleteData(String, String, Object[], String)

Builds a DeleteDataOperation to delete multiple rows of seed data.

DeleteData(String, String, String, Object, String)

Builds a DeleteDataOperation to delete a single row of seed data.

DeleteData(String, String, String, Object[], String)

Builds a DeleteDataOperation to delete multiple rows of seed data.

DeleteData(String, String[], Object[,], String)

Builds a DeleteDataOperation to delete multiple rows of seed data from a table with a composite (multi-column) key.

DeleteData(String, String[], Object[], String)

Builds a DeleteDataOperation to delete a single row of seed data from a table with a composite (multi-column) key.

DeleteData(String, String[], String[], Object[,], String)

Builds a DeleteDataOperation to delete multiple rows of seed data from a table with a composite (multi-column) key.

DeleteData(String, String[], String[], Object[], String)

Builds a DeleteDataOperation to delete a single row of seed data from a table with a composite (multi-column) key.

DropCheckConstraint(String, String, String)

Builds a DropCheckConstraintOperation to drop an existing check constraint.

DropColumn(String, String, String)

Builds a DropColumnOperation to drop an existing column.

DropForeignKey(String, String, String)

Builds a DropForeignKeyOperation to drop an existing foreign key constraint.

DropIndex(String, String, String)

Builds a DropIndexOperation to drop an existing index.

DropPrimaryKey(String, String, String)

Builds a DropPrimaryKeyOperation to drop an existing primary key.

DropSchema(String)

Builds a DropSchemaOperation to drop an existing schema.

DropSequence(String, String)

Builds a DropSequenceOperation to drop an existing sequence.

DropTable(String, String)

Builds a DropTableOperation to drop an existing table.

DropUniqueConstraint(String, String, String)

Builds a DropUniqueConstraintOperation to drop an existing unique constraint.

EnsureSchema(String)

Builds an EnsureSchemaOperation to ensure that a schema exists.

InsertData(String, String, Object, String)

Builds an InsertDataOperation to insert a single seed data value for a single column.

InsertData(String, String, Object[], String)

Builds an InsertDataOperation to insert multiple rows of seed data values for a single column.

InsertData(String, String, String, Object, String)

Builds an InsertDataOperation to insert a single seed data value for a single column.

InsertData(String, String, String, Object[], String)

Builds an InsertDataOperation to insert multiple rows of seed data values for a single column.

InsertData(String, String[], Object[,], String)

Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns.

InsertData(String, String[], Object[], String)

Builds an InsertDataOperation to insert a single row of seed data values.

InsertData(String, String[], String[], Object[,], String)

Builds an InsertDataOperation to insert multiple rows of seed data values for multiple columns.

InsertData(String, String[], String[], Object[], String)

Builds an InsertDataOperation to insert a single row of seed data values.

RenameColumn(String, String, String, String)

Builds a RenameColumnOperation to rename an existing column.

RenameIndex(String, String, String, String)

Builds a RenameIndexOperation to rename an existing index.

RenameSequence(String, String, String, String)

Builds a RenameSequenceOperation to rename an existing sequence.

RenameTable(String, String, String, String)

Builds a RenameTableOperation to rename an existing table.

RestartSequence(String, Int64, String)

Builds a RestartSequenceOperation to re-start an existing sequence.

RestartSequence(String, Nullable<Int64>, String)

Builds a RestartSequenceOperation to re-start an existing sequence.

Sql(String, Boolean)

Builds an SqlOperation to execute raw SQL.

UpdateData(String, String, Object, String, Object, String)

Builds an UpdateDataOperation to update a single row of seed data.

UpdateData(String, String, Object, String[], Object[], String)

Builds an UpdateDataOperation to update a single row of seed data.

UpdateData(String, String, Object[], String, Object[], String)

Builds an UpdateDataOperation to update multiple rows of seed data.

UpdateData(String, String, Object[], String[], Object[,], String)

Builds an UpdateDataOperation to update multiple rows of seed data.

UpdateData(String, String[], Object[,], String, Object[], String)

Builds an UpdateDataOperation to update multiple rows of seed data for a table with a composite (multi-column) key.

UpdateData(String, String[], Object[,], String[], Object[,], String)

Builds an UpdateDataOperation to update multiple rows of seed data for a table with a composite (multi-column) key.

UpdateData(String, String[], Object[], String, Object, String)

Builds an UpdateDataOperation to update a single row of seed data for a table with a composite (multi-column) key.

UpdateData(String, String[], Object[], String[], Object[], String)

Builds an UpdateDataOperation to update a single row of seed data for a table with a composite (multi-column) key.

UpdateData(String, String[], String[], Object[,], String[], String[], Object[,], String)

Builds an UpdateDataOperation to update multiple rows of seed data for a table with a composite (multi-column) key.

UpdateData(String, String[], String[], Object[], String[], String[], Object[], String)

Builds an UpdateDataOperation to update a single row of seed data for a table with a composite (multi-column) key.

Extension Methods

IsSqlite(MigrationBuilder)

Returns true if the database provider currently in use is the SQLite provider.

IsSqlServer(MigrationBuilder)

Returns true if the database provider currently in use is the SQL Server provider.

Applies to