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 時間戳/列版本。
- 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)
警告
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 時間戳/列版本。
- 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)
為給定欄位元資料產生 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 時間戳/列版本。
- 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)
為給定欄位元資料產生 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)
產生一個 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)
為給定欄位元資料產生 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 時間戳/列版本。
- nullable
- Boolean
表示欄位是否能儲存 NULL 數值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- computedColumnSql
- String
用來計算欄位值的 SQL 運算式。
- annotatable
- IAnnotatable
用來 MigrationOperation 查找任何自訂註解。
- model
- IModel
目標模型,如果操作存在且沒有模型,則可能是目標 null 模型。
- builder
- MigrationCommandListBuilder
用來新增 SQL 片段的指令建構器。