MigrationBuilder.AddCheckConstraint(String, String, String, String) 方法

定义

生成 以AddCheckConstraintOperation向表添加新检查约束。

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation> AddCheckConstraint (string name, string table, string sql, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation> AddCheckConstraint (string name, string table, string sql, string? schema = default);
abstract member AddCheckConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation>
override this.AddCheckConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation>
Public Overridable Function AddCheckConstraint (name As String, table As String, sql As String, Optional schema As String = Nothing) As OperationBuilder(Of AddCheckConstraintOperation)

参数

name
String

检查约束名称。

table
String

检查约束的表的名称。

sql
String

检查约束的约束 sql。

schema
String

包含检查约束的架构,或使用null默认架构。

返回

允许将批注添加到操作的生成器。

注解

有关详细信息和示例 ,请参阅数据库迁移

适用于