Search Results for

    Show / Hide Table of Contents
    View Source

    Class ColumnDefinition

    Represents the definition of a database column, including its data type, properties, and constraints.

    Inheritance
    object
    Namespace: Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class ColumnDefinition

    Constructors

    View Source

    ColumnDefinition()

    Declaration
    public ColumnDefinition()

    Properties

    View Source

    ConstraintName

    Gets or sets the name of the constraint associated with the column.

    Declaration
    public virtual string? ConstraintName { get; set; }
    Property Value
    Type Description
    string
    View Source

    CustomDbType

    Used for column types that cannot be natively mapped.

    Declaration
    public SpecialDbType? CustomDbType { get; set; }
    Property Value
    Type Description
    SpecialDbType?
    View Source

    CustomType

    Gets or sets a custom database type for the column, overriding the default type mapping if specified.

    Declaration
    public virtual string? CustomType { get; set; }
    Property Value
    Type Description
    string
    View Source

    DefaultValue

    Gets or sets the default value for the column.

    Declaration
    public virtual object? DefaultValue { get; set; }
    Property Value
    Type Description
    object
    View Source

    IsForeignKey

    Gets or sets a value indicating whether this column is a foreign key.

    Declaration
    public virtual bool IsForeignKey { get; set; }
    Property Value
    Type Description
    bool
    View Source

    IsIdentity

    Gets or sets a value indicating whether this column is an identity column.

    Declaration
    public virtual bool IsIdentity { get; set; }
    Property Value
    Type Description
    bool
    View Source

    IsIndexed

    Gets or sets a value indicating whether the column is indexed.

    Declaration
    public virtual bool IsIndexed { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Clustered?

    View Source

    IsNullable

    Gets or sets a value indicating whether the column allows null values.

    Declaration
    public virtual bool IsNullable { get; set; }
    Property Value
    Type Description
    bool
    View Source

    IsPrimaryKey

    Gets or sets a value indicating whether this column is part of the primary key.

    Declaration
    public virtual bool IsPrimaryKey { get; set; }
    Property Value
    Type Description
    bool
    View Source

    IsUnique

    Gets or sets a value indicating whether the column has a unique constraint.

    Declaration
    public virtual bool IsUnique { get; set; }
    Property Value
    Type Description
    bool
    View Source

    ModificationType

    Gets or sets a value indicating the type of modification (such as addition, update, or deletion) applied to the column definition.

    Declaration
    public virtual ModificationType ModificationType { get; set; }
    Property Value
    Type Description
    ModificationType
    View Source

    Name

    Gets or sets the name of the column.

    Declaration
    public virtual string Name { get; set; }
    Property Value
    Type Description
    string
    View Source

    Precision

    Gets or sets the precision of the column, which defines the total number of digits that can be stored for numeric data types.

    Declaration
    public virtual int Precision { get; set; }
    Property Value
    Type Description
    int
    View Source

    PrimaryKeyColumns

    Gets or sets the names of the columns that compose a composite primary key.

    Declaration
    public virtual string? PrimaryKeyColumns { get; set; }
    Property Value
    Type Description
    string
    Remarks

    When the primary key spans multiple columns

    View Source

    PrimaryKeyName

    Gets or sets the name of the primary key associated with this column, if any.

    Declaration
    public virtual string? PrimaryKeyName { get; set; }
    Property Value
    Type Description
    string
    View Source

    PropertyType

    Gets or sets the CLR Type that represents the property associated with this column. This type is used to infer the database type when DbType is not explicitly set, typically during initial table creation.

    Declaration
    public Type PropertyType { get; set; }
    Property Value
    Type Description
    Type
    Remarks

    When DbType isn't set explicitly the Type will be used to find the right DbType in the SqlSyntaxProvider. This type is typically used as part of an initial table creation

    View Source

    Seeding

    Gets or sets the initial seed value used for auto-incrementing the column, if applicable.

    Declaration
    public virtual int Seeding { get; set; }
    Property Value
    Type Description
    int
    View Source

    Size

    Gets or sets the maximum size or length of the column, typically used for string or binary data types.

    Declaration
    public virtual int Size { get; set; }
    Property Value
    Type Description
    int
    View Source

    TableName

    Gets or sets the name of the table that this column belongs to.

    Declaration
    public virtual string? TableName { get; set; }
    Property Value
    Type Description
    string
    View Source

    Type

    Gets or sets the data type of the column in the database.

    Declaration
    public virtual DbType? Type { get; set; }
    Property Value
    Type Description
    DbType?
    Remarks

    This type is typically used as part of a migration

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX