MigrationsSqlGenerator.ColumnDefinition Method

Definition

Overloads

ColumnDefinition(AddColumnOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

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

C#
protected virtual void ColumnDefinition (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void ColumnDefinition (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

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

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

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

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

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

C#
protected virtual void ColumnDefinition (string schema, string table, string name, Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void ColumnDefinition (string? schema, string table, string name, Microsoft.EntityFrameworkCore.Migrations.Operations.ColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

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

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

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

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

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

C#
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, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

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

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

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

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

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

C#
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, Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable annotatable, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

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

Entity Framework Core 2.2 and Entity Framework Core 2.1
Product Versions
Entity Framework Core 2.1, 2.2