MigrationBuilder.AlterColumn 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String)
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string schema = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default);
abstract member AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
override this.AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
Public Overridable Function AlterColumn(Of T) (name As String, table As String, Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional schema As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing) As OperationBuilder(Of AlterColumnOperation)
類型參數
- T
參數
- name
- String
- table
- String
- type
- String
- rowVersion
- Boolean
- schema
- String
- nullable
- Boolean
- defaultValue
- Object
- defaultValueSql
- String
- computedColumnSql
- String
傳回
適用於
AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String)
建造並 AlterColumnOperation 修改現有柱子。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string schema = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, Type oldClrType = default, string oldType = default, bool? oldUnicode = default, int? oldMaxLength = default, bool oldRowVersion = false, bool oldNullable = false, object oldDefaultValue = default, string oldDefaultValueSql = default, string oldComputedColumnSql = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type, bool? unicode, int? maxLength, bool rowVersion, string schema, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql, Type oldClrType, string oldType, bool? oldUnicode, int? oldMaxLength, bool oldRowVersion, bool oldNullable, object oldDefaultValue, string oldDefaultValueSql, string oldComputedColumnSql);
abstract member AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
override this.AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
Public Overridable Function AlterColumn(Of T) (name As String, table As String, Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional schema As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional oldClrType As Type = Nothing, Optional oldType As String = Nothing, Optional oldUnicode As Nullable(Of Boolean) = Nothing, Optional oldMaxLength As Nullable(Of Integer) = Nothing, Optional oldRowVersion As Boolean = false, Optional oldNullable As Boolean = false, Optional oldDefaultValue As Object = Nothing, Optional oldDefaultValueSql As String = Nothing, Optional oldComputedColumnSql As String = Nothing) As AlterOperationBuilder(Of AlterColumnOperation)
Public Overridable Function AlterColumn(Of T) (name As String, table As String, type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), rowVersion As Boolean, schema As String, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String, oldClrType As Type, oldType As String, oldUnicode As Nullable(Of Boolean), oldMaxLength As Nullable(Of Integer), oldRowVersion As Boolean, oldNullable As Boolean, oldDefaultValue As Object, oldDefaultValueSql As String, oldComputedColumnSql As String) As AlterOperationBuilder(Of AlterColumnOperation)
類型參數
- T
欄位所映射的 CLR 類型。
參數
- name
- String
數據行名稱。
- table
- String
包含數據行的數據表名稱。
- type
- String
欄位的儲存/資料庫類型。
- rowVersion
- Boolean
表示該欄位是否作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。
- schema
- String
包含該表格的結構,或 null 是否應該使用預設結構。
- nullable
- Boolean
表示欄位是否能儲存 NULL 數值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- computedColumnSql
- String
用來計算欄位值的 SQL 運算式。
- oldClrType
- Type
欄位先前映射的 CLR 類型。 可以是 null,此時前值被視為未知。
- oldType
- String
欄位的前一個儲存/資料庫類型。 可以是 null,此時前值被視為未知。
- oldRowVersion
- Boolean
表示該欄位是否先前作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。 可以是 null,此時前值被視為未知。
- oldNullable
- Boolean
表示欄位是否先前能儲存 NULL 數值。 可以是 null,此時前值被視為未知。
- oldDefaultValue
- Object
欄位的先前預設值。 可以是 null,此時前值被視為未知。
- oldDefaultValueSql
- String
先前用於欄位預設約束的 SQL 運算式。 可以是 null,此時前值被視為未知。
- oldComputedColumnSql
- String
先前用來計算欄位值的 SQL 運算式。 可以是 null,此時前值被視為未知。
傳回
一個建構器,允許在操作中加入註解。
適用於
AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>)
建造並 AlterColumnOperation 修改現有柱子。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string schema = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, Type oldClrType = default, string oldType = default, bool? oldUnicode = default, int? oldMaxLength = default, bool oldRowVersion = false, bool oldNullable = false, object oldDefaultValue = default, string oldDefaultValueSql = default, string oldComputedColumnSql = default, bool? fixedLength = default, bool? oldFixedLength = default);
abstract member AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
override this.AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
Public Overridable Function AlterColumn(Of T) (name As String, table As String, Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional schema As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional oldClrType As Type = Nothing, Optional oldType As String = Nothing, Optional oldUnicode As Nullable(Of Boolean) = Nothing, Optional oldMaxLength As Nullable(Of Integer) = Nothing, Optional oldRowVersion As Boolean = false, Optional oldNullable As Boolean = false, Optional oldDefaultValue As Object = Nothing, Optional oldDefaultValueSql As String = Nothing, Optional oldComputedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing, Optional oldFixedLength As Nullable(Of Boolean) = Nothing) As AlterOperationBuilder(Of AlterColumnOperation)
類型參數
- T
欄位所映射的 CLR 類型。
參數
- name
- String
數據行名稱。
- table
- String
包含數據行的數據表名稱。
- type
- String
欄位的儲存/資料庫類型。
- rowVersion
- Boolean
表示該欄位是否作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。
- schema
- String
包含該表格的結構,或 null 是否應該使用預設結構。
- nullable
- Boolean
表示欄位是否能儲存 NULL 數值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- computedColumnSql
- String
用來計算欄位值的 SQL 運算式。
- oldClrType
- Type
欄位先前映射的 CLR 類型。 可以是 null,此時前值被視為未知。
- oldType
- String
欄位的前一個儲存/資料庫類型。 可以是 null,此時前值被視為未知。
- oldRowVersion
- Boolean
表示該欄位是否先前作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。 可以是 null,此時前值被視為未知。
- oldNullable
- Boolean
表示欄位是否先前能儲存 NULL 數值。 可以是 null,此時前值被視為未知。
- oldDefaultValue
- Object
欄位的先前預設值。 可以是 null,此時前值被視為未知。
- oldDefaultValueSql
- String
先前用於欄位預設約束的 SQL 運算式。 可以是 null,此時前值被視為未知。
- oldComputedColumnSql
- String
先前用來計算欄位值的 SQL 運算式。 可以是 null,此時前值被視為未知。
傳回
一個建構器,允許在操作中加入註解。
適用於
AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>, String, String)
建造並 AlterColumnOperation 修改現有柱子。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string schema = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, Type oldClrType = default, string oldType = default, bool? oldUnicode = default, int? oldMaxLength = default, bool oldRowVersion = false, bool oldNullable = false, object oldDefaultValue = default, string oldDefaultValueSql = default, string oldComputedColumnSql = default, bool? fixedLength = default, bool? oldFixedLength = default, string comment = default, string oldComment = default);
abstract member AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
override this.AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
Public Overridable Function AlterColumn(Of T) (name As String, table As String, Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional schema As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional oldClrType As Type = Nothing, Optional oldType As String = Nothing, Optional oldUnicode As Nullable(Of Boolean) = Nothing, Optional oldMaxLength As Nullable(Of Integer) = Nothing, Optional oldRowVersion As Boolean = false, Optional oldNullable As Boolean = false, Optional oldDefaultValue As Object = Nothing, Optional oldDefaultValueSql As String = Nothing, Optional oldComputedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing, Optional oldFixedLength As Nullable(Of Boolean) = Nothing, Optional comment As String = Nothing, Optional oldComment As String = Nothing) As AlterOperationBuilder(Of AlterColumnOperation)
類型參數
- T
欄位所映射的 CLR 類型。
參數
- name
- String
數據行名稱。
- table
- String
包含數據行的數據表名稱。
- type
- String
欄位的儲存/資料庫類型。
- rowVersion
- Boolean
表示該欄位是否作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。
- schema
- String
包含該表格的結構,或 null 是否應該使用預設結構。
- nullable
- Boolean
表示欄位是否能儲存 NULL 數值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- computedColumnSql
- String
用來計算欄位值的 SQL 運算式。
- oldClrType
- Type
欄位先前映射的 CLR 類型。 可以是 null,此時前值被視為未知。
- oldType
- String
欄位的前一個儲存/資料庫類型。 可以是 null,此時前值被視為未知。
- oldRowVersion
- Boolean
表示該欄位是否先前作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。 可以是 null,此時前值被視為未知。
- oldNullable
- Boolean
表示欄位是否先前能儲存 NULL 數值。 可以是 null,此時前值被視為未知。
- oldDefaultValue
- Object
欄位的先前預設值。 可以是 null,此時前值被視為未知。
- oldDefaultValueSql
- String
先前用於欄位預設約束的 SQL 運算式。 可以是 null,此時前值被視為未知。
- oldComputedColumnSql
- String
先前用來計算欄位值的 SQL 運算式。 可以是 null,此時前值被視為未知。
- comment
- String
這是一篇與專欄相關的評論。
- oldComment
- String
之前的留言是要與專欄相關的。
傳回
一個建構器,允許在操作中加入註解。
適用於
AlterColumn<T>(String, String, String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Type, String, Nullable<Boolean>, Nullable<Int32>, Boolean, Boolean, Object, String, String, Nullable<Boolean>, Nullable<Boolean>, String, String, String, String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>)
建造並 AlterColumnOperation 修改現有柱子。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string? type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string? schema = default, bool nullable = false, object? defaultValue = default, string? defaultValueSql = default, string? computedColumnSql = default, Type? oldClrType = default, string? oldType = default, bool? oldUnicode = default, int? oldMaxLength = default, bool oldRowVersion = false, bool oldNullable = false, object? oldDefaultValue = default, string? oldDefaultValueSql = default, string? oldComputedColumnSql = default, bool? fixedLength = default, bool? oldFixedLength = default, string? comment = default, string? oldComment = default, string? collation = default, string? oldCollation = default, int? precision = default, int? oldPrecision = default, int? scale = default, int? oldScale = default, bool? stored = default, bool? oldStored = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation> AlterColumn<T>(string name, string table, string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string schema = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, Type oldClrType = default, string oldType = default, bool? oldUnicode = default, int? oldMaxLength = default, bool oldRowVersion = false, bool oldNullable = false, object oldDefaultValue = default, string oldDefaultValueSql = default, string oldComputedColumnSql = default, bool? fixedLength = default, bool? oldFixedLength = default, string comment = default, string oldComment = default, string collation = default, string oldCollation = default, int? precision = default, int? oldPrecision = default, int? scale = default, int? oldScale = default, bool? stored = default, bool? oldStored = default);
abstract member AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> * string * string * string * string * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<bool> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
override this.AlterColumn : string * string * string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Type * string * Nullable<bool> * Nullable<int> * bool * bool * obj * string * string * Nullable<bool> * Nullable<bool> * string * string * string * string * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<int> * Nullable<bool> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.AlterOperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation>
Public Overridable Function AlterColumn(Of T) (name As String, table As String, Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional schema As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional oldClrType As Type = Nothing, Optional oldType As String = Nothing, Optional oldUnicode As Nullable(Of Boolean) = Nothing, Optional oldMaxLength As Nullable(Of Integer) = Nothing, Optional oldRowVersion As Boolean = false, Optional oldNullable As Boolean = false, Optional oldDefaultValue As Object = Nothing, Optional oldDefaultValueSql As String = Nothing, Optional oldComputedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing, Optional oldFixedLength As Nullable(Of Boolean) = Nothing, Optional comment As String = Nothing, Optional oldComment As String = Nothing, Optional collation As String = Nothing, Optional oldCollation As String = Nothing, Optional precision As Nullable(Of Integer) = Nothing, Optional oldPrecision As Nullable(Of Integer) = Nothing, Optional scale As Nullable(Of Integer) = Nothing, Optional oldScale As Nullable(Of Integer) = Nothing, Optional stored As Nullable(Of Boolean) = Nothing, Optional oldStored As Nullable(Of Boolean) = Nothing) As AlterOperationBuilder(Of AlterColumnOperation)
類型參數
- T
欄位所映射的 CLR 類型。
參數
- name
- String
數據行名稱。
- table
- String
包含數據行的數據表名稱。
- type
- String
欄位的儲存/資料庫類型。
- rowVersion
- Boolean
表示該欄位是否作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。
- schema
- String
包含該表格的結構,或 null 是否應該使用預設結構。
- nullable
- Boolean
表示欄位是否能儲存 null 數值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- computedColumnSql
- String
用來計算欄位值的 SQL 運算式。
- oldClrType
- Type
欄位先前映射的 CLR 類型。 可以是 null,此時前值被視為未知。
- oldType
- String
欄位的前一個儲存/資料庫類型。 可以是 null,此時前值被視為未知。
- oldRowVersion
- Boolean
表示該欄位是否先前作為自動並發標記,例如SQL Server中的列版本/時間戳記欄位。 可以是 null,此時前值被視為未知。
- oldNullable
- Boolean
表示欄位是否先前能儲存 null 數值。 可以是 null,此時前值被視為未知。
- oldDefaultValue
- Object
欄位的先前預設值。 可以是 null,此時前值被視為未知。
- oldDefaultValueSql
- String
先前用於欄位預設約束的 SQL 運算式。 可以是 null,此時前值被視為未知。
- oldComputedColumnSql
- String
先前用來計算欄位值的 SQL 運算式。 可以是 null,此時前值被視為未知。
- comment
- String
這是一篇與專欄相關的評論。
- oldComment
- String
之前的留言是要與專欄相關的。
- collation
- String
一個用於欄位的排序。
- oldCollation
- String
之前的排序會套用到欄位。
傳回
一個建構器,允許在操作中加入註解。
備註
更多資訊與範例請參見 資料庫遷移 。