Share via


SqlServerMigrationsSqlGenerator.ColumnDefinition Method

Definition

Overloads

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

Generates a SQL fragment for a column definition for the given column metadata.

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

Generates a SQL fragment for a column definition for the given column metadata.

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

Generates a SQL fragment for a column definition for the given column metadata.

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

Generates a SQL fragment for a column definition for the given column metadata.

ColumnDefinition(AddColumnOperation, IModel, MigrationCommandListBuilder)

Generates a SQL fragment for a column definition in an AddColumnOperation.

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

Generates a SQL fragment for a column definition for the given column metadata.

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

Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs

Generates a SQL fragment for a column definition for the given column metadata.

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)

Parameters

schema
String

The schema that contains the table, or null to use the default schema.

table
String

The table that contains the column.

name
String

The column name.

clrType
Type

The CLR Type that the column is mapped to.

type
String

The database/store type for the column, or null if none has been specified.

unicode
Nullable<Boolean>

Indicates whether or not the column can contain Unicode data, or null if this is not applicable or not specified.

maxLength
Nullable<Int32>

The maximum amount of data that the column can contain, or null if this is not applicable or not specified.

fixedLength
Nullable<Boolean>

Indicates whether or not the column is constrained to fixed-length data.

rowVersion
Boolean

Indicates whether or not this column is an automatic concurrency token, such as a SQL Server timestamp/rowversion.

nullable
Boolean

Indicates whether or not the column can store NULL values.

defaultValue
Object

The default value for the column.

defaultValueSql
String

The SQL expression to use for the column's default constraint.

computedColumnSql
String

The SQL expression to use to compute the column value.

identity
Boolean

Indicates whether or not the column is an Identity column.

annotatable
IAnnotatable

The MigrationOperation to use to find any custom annotations.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to

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

Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs

Generates a SQL fragment for a column definition for the given column metadata.

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)

Parameters

schema
String

The schema that contains the table, or null to use the default schema.

table
String

The table that contains the column.

name
String

The column name.

clrType
Type

The CLR Type that the column is mapped to.

type
String

The database/store type for the column, or null if none has been specified.

unicode
Nullable<Boolean>

Indicates whether or not the column can contain Unicode data, or null if this is not applicable or not specified.

maxLength
Nullable<Int32>

The maximum amount of data that the column can contain, or null if this is not applicable or not specified.

fixedLength
Nullable<Boolean>

Indicates whether or not the column is constrained to fixed-length data.

rowVersion
Boolean

Indicates whether or not this column is an automatic concurrency token, such as a SQL Server timestamp/rowversion.

nullable
Boolean

Indicates whether or not the column can store NULL values.

defaultValue
Object

The default value for the column.

defaultValueSql
String

The SQL expression to use for the column's default constraint.

computedColumnSql
String

The SQL expression to use to compute the column value.

annotatable
IAnnotatable

The MigrationOperation to use to find any custom annotations.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to

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

Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs

Caution

Use the overload with most parameters

Generates a SQL fragment for a column definition for the given column metadata.

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)

Parameters

schema
String

The schema that contains the table, or null to use the default schema.

table
String

The table that contains the column.

name
String

The column name.

clrType
Type

The CLR Type that the column is mapped to.

type
String

The database/store type for the column, or null if none has been specified.

unicode
Nullable<Boolean>

Indicates whether or not the column can contain Unicode data, or null if this is not applicable or not specified.

maxLength
Nullable<Int32>

The maximum amount of data that the column can contain, or null if this is not applicable or not specified.

rowVersion
Boolean

Indicates whether or not this column is an automatic concurrency token, such as a SQL Server timestamp/rowversion.

nullable
Boolean

Indicates whether or not the column can store NULL values.

defaultValue
Object

The default value for the column.

defaultValueSql
String

The SQL expression to use for the column's default constraint.

computedColumnSql
String

The SQL expression to use to compute the column value.

identity
Boolean

Indicates whether or not the column is an Identity column.

annotatable
IAnnotatable

The MigrationOperation to use to find any custom annotations.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Attributes

Applies to

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

Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs

Generates a SQL fragment for a column definition for the given column metadata.

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)

Parameters

schema
String

The schema that contains the table, or null to use the default schema.

table
String

The table that contains the column.

name
String

The column name.

operation
ColumnOperation

The column metadata.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to

ColumnDefinition(AddColumnOperation, IModel, MigrationCommandListBuilder)

Source:
SqlServerMigrationsSqlGenerator.cs
Source:
SqlServerMigrationsSqlGenerator.cs

Generates a SQL fragment for a column definition in an 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)

Parameters

operation
AddColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to

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

Source:
SqlServerMigrationsSqlGenerator.cs

Generates a SQL fragment for a column definition for the given column metadata.

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)

Parameters

schema
String

The schema that contains the table, or null to use the default schema.

table
String

The table that contains the column.

name
String

The column name.

clrType
Type

The CLR Type that the column is mapped to.

type
String

The database/store type for the column, or null if none has been specified.

unicode
Nullable<Boolean>

Indicates whether or not the column can contain Unicode data, or null if this is not applicable or not specified.

maxLength
Nullable<Int32>

The maximum amount of data that the column can contain, or null if this is not applicable or not specified.

rowVersion
Boolean

Indicates whether or not this column is an automatic concurrency token, such as a SQL Server timestamp/rowversion.

nullable
Boolean

Indicates whether or not the column can store NULL values.

defaultValue
Object

The default value for the column.

defaultValueSql
String

The SQL expression to use for the column's default constraint.

computedColumnSql
String

The SQL expression to use to compute the column value.

annotatable
IAnnotatable

The MigrationOperation to use to find any custom annotations.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to