MigrationBuilder.CreateIndex 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CreateIndex(String, String, String[], String, Boolean, String, Boolean[])
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
生成 , CreateIndexOperation 以创建新的复合 (多列) 索引。
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)
参数
- name
- String
索引名称。
- table
- String
包含索引的表。
- columns
- String[]
已编制索引的列的有序列表。
- schema
- String
包含表的架构,或使用 null
默认架构。
- unique
- Boolean
指示索引是否强制实施唯一性。
- filter
- String
要应用于索引的筛选器,或 null
无筛选器的筛选器。
- descending
- Boolean[]
一组值,指示每个相应的索引列是否具有降序排序顺序。
如果 null
为 ,则所有列都将按升序排列。
返回
允许将批注添加到操作的生成器。
注解
有关详细信息和示例 ,请参阅数据库迁移 。
适用于
CreateIndex(String, String, String, String, Boolean, String, Boolean[])
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
生成 以 CreateIndexOperation 创建新索引。
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)
参数
- name
- String
索引名称。
- table
- String
包含索引的表。
- column
- String
索引的列。
- schema
- String
包含表的架构,或使用 null
默认架构。
- unique
- Boolean
指示索引是否强制实施唯一性。
- filter
- String
要应用于索引的筛选器,或 null
无筛选器的筛选器。
- descending
- Boolean[]
一组值,指示每个相应的索引列是否具有降序排序顺序。
如果 null
为 ,则所有列都将按升序排列。
如果数组为空,则所有列将采用降序。
返回
允许将批注添加到操作的生成器。
注解
有关详细信息和示例 ,请参阅数据库迁移 。
适用于
CreateIndex(String, String, String[], String, Boolean, String)
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
生成 , CreateIndexOperation 以创建新的复合 (多列) 索引。
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)
参数
- name
- String
索引名称。
- table
- String
包含索引的表。
- columns
- String[]
已编制索引的列的有序列表。
- schema
- String
包含表的架构,或使用 null
默认架构。
- unique
- Boolean
指示索引是否强制实施唯一性。
- filter
- String
要应用于索引的筛选器,或 null
无筛选器的筛选器。
返回
允许将批注添加到操作的生成器。
注解
有关详细信息 ,请参阅数据库迁移 。
适用于
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)
参数
- name
- String
- table
- String
- columns
- String[]
- schema
- String
- unique
- Boolean
返回
适用于
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)
参数
- name
- String
- table
- String
- column
- String
- schema
- String
- unique
- Boolean
返回
适用于
CreateIndex(String, String, String, String, Boolean, String)
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
- Source:
- MigrationBuilder.cs
生成 以 CreateIndexOperation 创建新索引。
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)
参数
- name
- String
索引名称。
- table
- String
包含索引的表。
- column
- String
索引的列。
- schema
- String
包含表的架构,或使用 null
默认架构。
- unique
- Boolean
指示索引是否强制实施唯一性。
- filter
- String
要应用于索引的筛选器,或 null
无筛选器的筛选器。
返回
允许将批注添加到操作的生成器。
注解
有关详细信息 ,请参阅数据库迁移 。