Share via


MigrationBuilder.CreateIndex Method

Definition

Overloads

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, Boolean[])

Builds a CreateIndexOperation to create a new 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)
CreateIndex(String, String, String, String, Boolean)
CreateIndex(String, String, String, String, Boolean, String)

Builds a CreateIndexOperation to create a new index.

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

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

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string[] columns, string? schema = default, bool unique = false, string? filter = default, bool[]? descending = default);
abstract member CreateIndex : string * string * string[] * string * bool * string * bool[] -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string[] * string * bool * string * bool[] -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, columns As String(), Optional schema As String = Nothing, Optional unique As Boolean = false, Optional filter As String = Nothing, Optional descending As Boolean() = Nothing) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String

The index name.

table
String

The table that contains the index.

columns
String[]

The ordered list of columns that are indexed.

schema
String

The schema that contains the table, or null to use the default schema.

unique
Boolean

Indicates whether or not the index enforces uniqueness.

filter
String

The filter to apply to the index, or null for no filter.

descending
Boolean[]

A set of values indicating whether each corresponding index column has descending sort order. If null, all columns will have ascending order.

Returns

A builder to allow annotations to be added to the operation.

Remarks

See Database migrations for more information and examples.

Applies to

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

Builds a CreateIndexOperation to create a new index.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string column, string? schema = default, bool unique = false, string? filter = default, bool[]? descending = default);
abstract member CreateIndex : string * string * string * string * bool * string * bool[] -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string * string * bool * string * bool[] -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, column As String, Optional schema As String = Nothing, Optional unique As Boolean = false, Optional filter As String = Nothing, Optional descending As Boolean() = Nothing) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String

The index name.

table
String

The table that contains the index.

column
String

The column that is indexed.

schema
String

The schema that contains the table, or null to use the default schema.

unique
Boolean

Indicates whether or not the index enforces uniqueness.

filter
String

The filter to apply to the index, or null for no filter.

descending
Boolean[]

A set of values indicating whether each corresponding index column has descending sort order. If null, all columns will have ascending order. If an empty array, all columns will have descending order.

Returns

A builder to allow annotations to be added to the operation.

Remarks

See Database migrations for more information and examples.

Applies to

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

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

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string[] columns, string schema = default, bool unique = false, string filter = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string[] columns, string? schema = default, bool unique = false, string? filter = default);
abstract member CreateIndex : string * string * string[] * string * bool * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string[] * string * bool * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, columns As String(), Optional schema As String = Nothing, Optional unique As Boolean = false, Optional filter As String = Nothing) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String

The index name.

table
String

The table that contains the index.

columns
String[]

The ordered list of columns that are indexed.

schema
String

The schema that contains the table, or null to use the default schema.

unique
Boolean

Indicates whether or not the index enforces uniqueness.

filter
String

The filter to apply to the index, or null for no filter.

Returns

A builder to allow annotations to be added to the operation.

Remarks

See Database migrations for more information.

Applies to

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

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string[] columns, string schema = default, bool unique = false);
abstract member CreateIndex : string * string * string[] * string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string[] * string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, columns As String(), Optional schema As String = Nothing, Optional unique As Boolean = false) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String
table
String
columns
String[]
schema
String
unique
Boolean

Returns

Applies to

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

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string column, string schema = default, bool unique = false);
abstract member CreateIndex : string * string * string * string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string * string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, column As String, Optional schema As String = Nothing, Optional unique As Boolean = false) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String
table
String
column
String
schema
String
unique
Boolean

Returns

Applies to

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

Builds a CreateIndexOperation to create a new index.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string column, string schema = default, bool unique = false, string filter = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> CreateIndex (string name, string table, string column, string? schema = default, bool unique = false, string? filter = default);
abstract member CreateIndex : string * string * string * string * bool * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
override this.CreateIndex : string * string * string * string * bool * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation>
Public Overridable Function CreateIndex (name As String, table As String, column As String, Optional schema As String = Nothing, Optional unique As Boolean = false, Optional filter As String = Nothing) As OperationBuilder(Of CreateIndexOperation)

Parameters

name
String

The index name.

table
String

The table that contains the index.

column
String

The column that is indexed.

schema
String

The schema that contains the table, or null to use the default schema.

unique
Boolean

Indicates whether or not the index enforces uniqueness.

filter
String

The filter to apply to the index, or null for no filter.

Returns

A builder to allow annotations to be added to the operation.

Remarks

See Database migrations for more information.

Applies to