Search Results for

    Show / Hide Table of Contents

    Class ColumnBase

    The base class for column definitions

    Inheritance
    object
    ColumnBase
    Implements
    IColumn
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: FluentMigrator.Runner.Generators.Base
    Assembly: FluentMigrator.Runner.Core.dll
    Syntax
    public abstract class ColumnBase : IColumn

    Constructors

    | Edit this page View Source

    ColumnBase(ITypeMap, IQuoter)

    Initializes a new instance of the ColumnBase class.

    Declaration
    protected ColumnBase(ITypeMap typeMap, IQuoter quoter)
    Parameters
    Type Name Description
    ITypeMap typeMap

    The type map

    IQuoter quoter

    The quoter

    Properties

    | Edit this page View Source

    ClauseOrder

    Gets or sets the clause order

    Declaration
    protected IList<Func<ColumnDefinition, string>> ClauseOrder { get; set; }
    Property Value
    Type Description
    IList<Func<ColumnDefinition, string>>
    | Edit this page View Source

    ForeignKeyConstraint

    The default foreign key constraint format

    Declaration
    public virtual string ForeignKeyConstraint { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Quoter

    Gets the quoter

    Declaration
    protected IQuoter Quoter { get; }
    Property Value
    Type Description
    IQuoter

    Methods

    | Edit this page View Source

    AddPrimaryKeyConstraint(string, IEnumerable<ColumnDefinition>)

    Creates the primary key constraint SQL fragment

    Declaration
    public virtual string AddPrimaryKeyConstraint(string tableName, IEnumerable<ColumnDefinition> primaryKeyColumns)
    Parameters
    Type Name Description
    string tableName

    The table name

    IEnumerable<ColumnDefinition> primaryKeyColumns

    The primary key column definitions

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    FormatCascade(string, Rule)

    Formats the foreign key cascading SQL fragment

    Declaration
    public virtual string FormatCascade(string onWhat, Rule rule)
    Parameters
    Type Name Description
    string onWhat

    The action this cascade clause applies to (update or delete)

    Rule rule

    The cascade rule

    Returns
    Type Description
    string

    The formatted SQL fragment

    | Edit this page View Source

    FormatCollation(ColumnDefinition)

    Formats the collation of a text column

    Declaration
    protected virtual string FormatCollation(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    FormatDefaultValue(ColumnDefinition)

    Formats the column default value

    Declaration
    protected virtual string FormatDefaultValue(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The formatted column default value

    | Edit this page View Source

    FormatForeignKey(ForeignKeyDefinition, Func<ForeignKeyDefinition, string>)

    Formats the foreign key SQL fragment optionally using a custom foreign key name generator

    Declaration
    public virtual string FormatForeignKey(ForeignKeyDefinition foreignKey, Func<ForeignKeyDefinition, string> fkNameGeneration)
    Parameters
    Type Name Description
    ForeignKeyDefinition foreignKey

    The foreign key definition

    Func<ForeignKeyDefinition, string> fkNameGeneration

    The custom foreign key name generator

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    FormatIdentity(ColumnDefinition)

    Formats the identity SQL fragment

    Declaration
    protected abstract string FormatIdentity(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The formatted identity SQL fragment

    | Edit this page View Source

    FormatNullable(ColumnDefinition)

    Formats the (not) null constraint

    Declaration
    protected virtual string FormatNullable(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The formatted (not) null constraint

    | Edit this page View Source

    FormatPrimaryKey(ColumnDefinition)

    Formats the primary key constraint directly attached to the column

    Declaration
    protected virtual string FormatPrimaryKey(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The primary key constraint SQL fragment

    | Edit this page View Source

    FormatString(ColumnDefinition)

    Formats the column name

    Declaration
    public virtual string FormatString(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The (probably) quoted column name

    | Edit this page View Source

    FormatType(ColumnDefinition)

    Formats the column type

    Declaration
    protected virtual string FormatType(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The formatted column type

    | Edit this page View Source

    Generate(ColumnDefinition)

    Generates the complete column definition SQL fragment

    Declaration
    public virtual string Generate(ColumnDefinition column)
    Parameters
    Type Name Description
    ColumnDefinition column

    The column definition

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    Generate(IEnumerable<ColumnDefinition>, string)

    Generate the SQL fragment for all column definitions

    Declaration
    public virtual string Generate(IEnumerable<ColumnDefinition> columns, string tableName)
    Parameters
    Type Name Description
    IEnumerable<ColumnDefinition> columns

    The column definitions

    string tableName

    The table name

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    GenerateForeignKeyName(ForeignKeyDefinition)

    Generates the default foreign key name

    Declaration
    public virtual string GenerateForeignKeyName(ForeignKeyDefinition foreignKey)
    Parameters
    Type Name Description
    ForeignKeyDefinition foreignKey

    The foreign key definition

    Returns
    Type Description
    string

    The SQL fragment

    | Edit this page View Source

    GetPrimaryKeyConstraintName(IEnumerable<ColumnDefinition>, string)

    Gets the name of the primary key constraint. Some Generators may need to override if the constraint name is limited

    Declaration
    protected virtual string GetPrimaryKeyConstraintName(IEnumerable<ColumnDefinition> primaryKeyColumns, string tableName)
    Parameters
    Type Name Description
    IEnumerable<ColumnDefinition> primaryKeyColumns

    The primary key columns

    string tableName

    The table name

    Returns
    Type Description
    string

    The constraint clause

    | Edit this page View Source

    GetTypeMap(DbType, int, int)

    Gets the formatted type from the type map

    Declaration
    [Obsolete]
    protected string GetTypeMap(DbType value, int size, int precision)
    Parameters
    Type Name Description
    DbType value

    The database type

    int size

    The size (or precision)

    int precision

    The precision (or scale)

    Returns
    Type Description
    string

    The formatted column type

    | Edit this page View Source

    GetTypeMap(DbType, int?, int?)

    Gets the formatted type from the type map

    Declaration
    protected string GetTypeMap(DbType value, int? size, int? precision)
    Parameters
    Type Name Description
    DbType value

    The database type

    int? size

    The size (or precision)

    int? precision

    The precision (or scale)

    Returns
    Type Description
    string

    The formatted column type

    | Edit this page View Source

    ShouldPrimaryKeysBeAddedSeparately(IEnumerable<ColumnDefinition>)

    Returns a value indicating whether the primary key constraint should be added separately

    Declaration
    public virtual bool ShouldPrimaryKeysBeAddedSeparately(IEnumerable<ColumnDefinition> primaryKeyColumns)
    Parameters
    Type Name Description
    IEnumerable<ColumnDefinition> primaryKeyColumns

    The primary key column definitions

    Returns
    Type Description
    bool

    true when the primary key constraint should be added separately

    Implements

    IColumn
    • Edit this page
    • View Source
    In this article
    Back to top
    Copyright © 2018 Fluent Migrator Project
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.