語言

SqlServerMigrationsSqlGenerator.ColumnDefinition 方法

定義

多載

名稱 Description
ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Boolean, Boolean, Object, String, String, Boolean, IAnnotatable, IModel, MigrationCommandListBuilder)

為給定欄位元資料產生 SQL 片段,以定義欄位。

ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Boolean, IAnnotatable, IModel, MigrationCommandListBuilder)
已淘汰.

為給定欄位元資料產生 SQL 片段,以定義欄位。

ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Boolean, Boolean, Object, String, String, IAnnotatable, IModel, MigrationCommandListBuilder)

為給定欄位元資料產生 SQL 片段,以定義欄位。

ColumnDefinition(String, String, String, ColumnOperation, IModel, MigrationCommandListBuilder)

為給定欄位元資料產生 SQL 片段,以定義欄位。

ColumnDefinition(AddColumnOperation, IModel, MigrationCommandListBuilder)

產生一個 SQL 片段,用於欄位定義。AddColumnOperation

ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, IAnnotatable, IModel, MigrationCommandListBuilder)

為給定欄位元資料產生 SQL 片段,以定義欄位。

ColumnDefinition(String, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Nullable<Boolean>, Boolean, Boolean, Object, String, String, Boolean, IAnnotatable, IModel, MigrationCommandListBuilder)

來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs

為給定欄位元資料產生 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

數據行名稱。

clrType
Type

欄位所映射的 CLR Type 。

type
String

欄位的資料庫/儲存類型,或 null 若未指定欄位,則為該欄位。

unicode
Nullable<Boolean>

指示欄位是否可包含 Unicode 資料,或 null 是否不適用或未指定。

maxLength
Nullable<Int32>

欄位可容納的最大資料量,或 null 是否不適用或未指定。

fixedLength
Nullable<Boolean>

表示欄位是否受限於固定長度資料。

rowVersion
Boolean

表示此欄位是否為自動並發標記,例如 SQL Server 時間戳/列版本。

nullable
Boolean

表示欄位是否能儲存 NULL 數值。

defaultValue
Object

資料行的預設值。

defaultValueSql
String

欄位預設約束的SQL表達式。

computedColumnSql
String

用來計算欄位值的 SQL 運算式。

identity
Boolean

表示該欄位是否為身份欄位。

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)

來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs

警告

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

數據行名稱。

clrType
Type

欄位所映射的 CLR Type 。

type
String

欄位的資料庫/儲存類型,或 null 若未指定欄位,則為該欄位。

unicode
Nullable<Boolean>

指示欄位是否可包含 Unicode 資料,或 null 是否不適用或未指定。

maxLength
Nullable<Int32>

欄位可容納的最大資料量,或 null 是否不適用或未指定。

rowVersion
Boolean

表示此欄位是否為自動並發標記,例如 SQL Server 時間戳/列版本。

nullable
Boolean

表示欄位是否能儲存 NULL 數值。

defaultValue
Object

資料行的預設值。

defaultValueSql
String

欄位預設約束的SQL表達式。

computedColumnSql
String

用來計算欄位值的 SQL 運算式。

identity
Boolean

表示該欄位是否為身份欄位。

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)

來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs

為給定欄位元資料產生 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

數據行名稱。

clrType
Type

欄位所映射的 CLR Type 。

type
String

欄位的資料庫/儲存類型,或 null 若未指定欄位,則為該欄位。

unicode
Nullable<Boolean>

指示欄位是否可包含 Unicode 資料,或 null 是否不適用或未指定。

maxLength
Nullable<Int32>

欄位可容納的最大資料量,或 null 是否不適用或未指定。

fixedLength
Nullable<Boolean>

表示欄位是否受限於固定長度資料。

rowVersion
Boolean

表示此欄位是否為自動並發標記,例如 SQL Server 時間戳/列版本。

nullable
Boolean

表示欄位是否能儲存 NULL 數值。

defaultValue
Object

資料行的預設值。

defaultValueSql
String

欄位預設約束的SQL表達式。

computedColumnSql
String

用來計算欄位值的 SQL 運算式。

annotatable
IAnnotatable

用來 MigrationOperation 查找任何自訂註解。

model
IModel

目標模型,如果操作存在且沒有模型,則可能是目標 null 模型。

builder
MigrationCommandListBuilder

用來新增 SQL 片段的指令建構器。

適用於

ColumnDefinition(String, String, String, ColumnOperation, IModel, MigrationCommandListBuilder)

來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs

為給定欄位元資料產生 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)

來源:
SqlServerMigrationsSqlGenerator.cs
來源:
SqlServerMigrationsSqlGenerator.cs

產生一個 SQL 片段,用於欄位定義。AddColumnOperation

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)

來源:
SqlServerMigrationsSqlGenerator.cs

為給定欄位元資料產生 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

數據行名稱。

clrType
Type

欄位所映射的 CLR Type 。

type
String

欄位的資料庫/儲存類型,或 null 若未指定欄位,則為該欄位。

unicode
Nullable<Boolean>

指示欄位是否可包含 Unicode 資料,或 null 是否不適用或未指定。

maxLength
Nullable<Int32>

欄位可容納的最大資料量,或 null 是否不適用或未指定。

rowVersion
Boolean

表示此欄位是否為自動並發標記,例如 SQL Server 時間戳/列版本。

nullable
Boolean

表示欄位是否能儲存 NULL 數值。

defaultValue
Object

資料行的預設值。

defaultValueSql
String

欄位預設約束的SQL表達式。

computedColumnSql
String

用來計算欄位值的 SQL 運算式。

annotatable
IAnnotatable

用來 MigrationOperation 查找任何自訂註解。

model
IModel

目標模型,如果操作存在且沒有模型,則可能是目標 null 模型。

builder
MigrationCommandListBuilder

用來新增 SQL 片段的指令建構器。

適用於