SqlServerMigrationsSqlGenerator.ColumnDefinition 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Boolean, Boolean, Object, String, String, Boolean, IAnnotatable, IModel, MigrationCommandListBuilder)
为给定列元数据的列定义生成 SQL 片段。
protected virtual void ColumnDefinition (string schema, string table, string name, Type clrType, string type, bool? unicode, int? maxLength, bool? fixedLength, bool rowVersion, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, bool identity, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : string * string * string * Type * string * Nullable<bool> * Nullable<int> * Nullable<bool> * bool * bool * obj * string * string * bool * Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overridable Sub ColumnDefinition (schema As String, table As String, name As String, clrType As Type, type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), fixedLength As Nullable(Of Boolean), rowVersion As Boolean, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String, identity As Boolean, annotatable As IAnnotatable, model As IModel, builder As MigrationCommandListBuilder)
参数
- schema
- String
包含表的架构,或使用 null
默认架构。
- table
- String
包含列的表。
- name
- String
列名称。
- type
- String
列的数据库/存储类型,如果未 null
指定,则为 。
- rowVersion
- Boolean
指示此列是否是自动并发标记,例如SQL Server时间戳/rowversion。
- nullable
- Boolean
指示列是否可以存储 NULL
值。
- defaultValue
- Object
列的默认值。
- defaultValueSql
- String
要用于列的默认约束的 SQL 表达式。
- computedColumnSql
- String
用于计算列值的 SQL 表达式。
- identity
- Boolean
指示该列是否为 Identity 列。
- annotatable
- IAnnotatable
MigrationOperation用于查找任何自定义批注的 。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。
适用于
ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Boolean, Boolean, Object, String, String, IAnnotatable, IModel, MigrationCommandListBuilder)
为给定列元数据的列定义生成 SQL 片段。
protected override void ColumnDefinition (string schema, string table, string name, Type clrType, string type, bool? unicode, int? maxLength, bool? fixedLength, bool rowVersion, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : string * string * string * Type * string * Nullable<bool> * Nullable<int> * Nullable<bool> * bool * bool * obj * string * string * Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overrides Sub ColumnDefinition (schema As String, table As String, name As String, clrType As Type, type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), fixedLength As Nullable(Of Boolean), rowVersion As Boolean, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String, annotatable As IAnnotatable, model As IModel, builder As MigrationCommandListBuilder)
参数
- schema
- String
包含表的架构,或使用 null
默认架构。
- table
- String
包含列的表。
- name
- String
列名称。
- type
- String
列的数据库/存储类型,如果未 null
指定,则为 。
- rowVersion
- Boolean
指示此列是否是自动并发标记,例如SQL Server时间戳/rowversion。
- nullable
- Boolean
指示列是否可以存储 NULL
值。
- defaultValue
- Object
列的默认值。
- defaultValueSql
- String
要用于列的默认约束的 SQL 表达式。
- computedColumnSql
- String
用于计算列值的 SQL 表达式。
- annotatable
- IAnnotatable
MigrationOperation用于查找任何自定义批注的 。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。
适用于
ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Boolean, IAnnotatable, IModel, MigrationCommandListBuilder)
注意
Use the overload with most parameters
为给定列元数据的列定义生成 SQL 片段。
protected virtual void ColumnDefinition (string schema, string table, string name, Type clrType, string type, bool? unicode, int? maxLength, bool rowVersion, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, bool identity, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
[System.Obsolete("Use the overload with most parameters")]
protected virtual void ColumnDefinition (string schema, string table, string name, Type clrType, string type, bool? unicode, int? maxLength, bool rowVersion, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, bool identity, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : string * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * bool * Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
[<System.Obsolete("Use the overload with most parameters")>]
override this.ColumnDefinition : string * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * bool * Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overridable Sub ColumnDefinition (schema As String, table As String, name As String, clrType As Type, type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), rowVersion As Boolean, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String, identity As Boolean, annotatable As IAnnotatable, model As IModel, builder As MigrationCommandListBuilder)
参数
- schema
- String
包含表的架构,或使用 null
默认架构。
- table
- String
包含列的表。
- name
- String
列名称。
- type
- String
列的数据库/存储类型,如果未 null
指定,则为 。
- rowVersion
- Boolean
指示此列是否是自动并发标记,例如SQL Server时间戳/rowversion。
- nullable
- Boolean
指示列是否可以存储 NULL
值。
- defaultValue
- Object
列的默认值。
- defaultValueSql
- String
要用于列的默认约束的 SQL 表达式。
- computedColumnSql
- String
用于计算列值的 SQL 表达式。
- identity
- Boolean
指示该列是否为 Identity 列。
- annotatable
- IAnnotatable
MigrationOperation用于查找任何自定义批注的 。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。
- 属性
适用于
ColumnDefinition(String, String, String, ColumnOperation, IModel, MigrationCommandListBuilder)
为给定列元数据的列定义生成 SQL 片段。
protected override void ColumnDefinition (string schema, string table, string name, Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
protected override void ColumnDefinition (string? schema, string table, string name, Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : string * string * string * Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overrides Sub ColumnDefinition (schema As String, table As String, name As String, operation As ColumnOperation, model As IModel, builder As MigrationCommandListBuilder)
参数
- schema
- String
包含表的架构,或使用 null
默认架构。
- table
- String
包含列的表。
- name
- String
列名称。
- operation
- ColumnOperation
列元数据。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。
适用于
ColumnDefinition(AddColumnOperation, IModel, MigrationCommandListBuilder)
为 中的 AddColumnOperation列定义生成 SQL 片段。
protected override void ColumnDefinition (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overrides Sub ColumnDefinition (operation As AddColumnOperation, model As IModel, builder As MigrationCommandListBuilder)
参数
- operation
- AddColumnOperation
操作。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。
适用于
ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, IAnnotatable, IModel, MigrationCommandListBuilder)
为给定列元数据的列定义生成 SQL 片段。
protected override void ColumnDefinition (string schema, string table, string name, Type clrType, string type, bool? unicode, int? maxLength, bool rowVersion, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.ColumnDefinition : string * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable * Microsoft.EntityFrameworkCore.Metadata.IModel * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overrides Sub ColumnDefinition (schema As String, table As String, name As String, clrType As Type, type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), rowVersion As Boolean, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String, annotatable As IAnnotatable, model As IModel, builder As MigrationCommandListBuilder)
参数
- schema
- String
包含表的架构,或使用 null
默认架构。
- table
- String
包含列的表。
- name
- String
列名称。
- type
- String
列的数据库/存储类型,如果未 null
指定,则为 。
- rowVersion
- Boolean
指示此列是否是自动并发标记,例如SQL Server时间戳/rowversion。
- nullable
- Boolean
指示列是否可以存储 NULL
值。
- defaultValue
- Object
列的默认值。
- defaultValueSql
- String
要用于列的默认约束的 SQL 表达式。
- computedColumnSql
- String
用于计算列值的 SQL 表达式。
- annotatable
- IAnnotatable
MigrationOperation用于查找任何自定义批注的 。
- model
- IModel
如果存在没有模型的操作,则 null
可能是目标模型。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。