Share via


DbMigration.CreateIndex Method

Definition

Overloads

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

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

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

Adds an operation to create an index on multiple columns.

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, 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 a single column.

protected internal void CreateIndex (string table, string column, bool unique = false, string name = null, object anonymousArguments = null);
member this.CreateIndex : string * string * bool * string * obj -> unit
Protected Friend Sub CreateIndex (table As String, column As String, Optional unique As Boolean = false, Optional name As String = null, Optional anonymousArguments As Object = null)

Parameters

table
String

The name of the table to create the index on. Schema name is optional, if no schema is specified then dbo is assumed.

column
String

The name of the column to create the index on.

unique
Boolean

A value indicating if this is a unique index. If no value is supplied a non-unique index will be created.

name
String

The name to use for the index in the database. If no value is supplied a unique name will be generated.

anonymousArguments
Object

Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.

Applies to

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

Adds an operation to create an index on multiple columns.

protected internal void CreateIndex (string table, string[] columns, bool unique = false, string name = null, object anonymousArguments = null);
member this.CreateIndex : string * string[] * bool * string * obj -> unit
Protected Friend Sub CreateIndex (table As String, columns As String(), Optional unique As Boolean = false, Optional name As String = null, Optional anonymousArguments As Object = null)

Parameters

table
String

The name of the table to create the index on. Schema name is optional, if no schema is specified then dbo is assumed.

columns
String[]

The name of the columns to create the index on.

unique
Boolean

A value indicating if this is a unique index. If no value is supplied a non-unique index will be created.

name
String

The name to use for the index in the database. If no value is supplied a unique name will be generated.

anonymousArguments
Object

Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.

Applies to

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.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void CreateIndex (string table, string column, bool unique = false, string name = null, bool clustered = false, object anonymousArguments = null);
member this.CreateIndex : string * string * bool * string * bool * obj -> unit
Protected Friend Sub CreateIndex (table As String, column As String, Optional unique As Boolean = false, Optional name As String = null, Optional clustered As Boolean = false, Optional anonymousArguments As Object = null)

Parameters

table
String

The name of the table to create the index on. Schema name is optional, if no schema is specified then dbo is assumed.

column
String

The name of the column to create the index on.

unique
Boolean

A value indicating if this is a unique index. If no value is supplied a non-unique index will be created.

name
String

The name to use for the index in the database. If no value is supplied a unique name will be generated.

clustered
Boolean

A value indicating whether or not this is a clustered index.

anonymousArguments
Object

Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.

Attributes

Applies to

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.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void CreateIndex (string table, string[] columns, bool unique = false, string name = null, bool clustered = false, object anonymousArguments = null);
member this.CreateIndex : string * string[] * bool * string * bool * obj -> unit
Protected Friend Sub CreateIndex (table As String, columns As String(), Optional unique As Boolean = false, Optional name As String = null, Optional clustered As Boolean = false, Optional anonymousArguments As Object = null)

Parameters

table
String

The name of the table to create the index on. Schema name is optional, if no schema is specified then dbo is assumed.

columns
String[]

The name of the columns to create the index on.

unique
Boolean

A value indicating if this is a unique index. If no value is supplied a non-unique index will be created.

name
String

The name to use for the index in the database. If no value is supplied a unique name will be generated.

clustered
Boolean

A value indicating whether or not this is a clustered index.

anonymousArguments
Object

Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.

Attributes

Applies to