Search Results for

    Show / Hide Table of Contents
    View Source

    Class MigrationExpressionBase

    Provides a base class for migration expressions.

    Inheritance
    object
    Namespace: Umbraco.Cms.Infrastructure.Migrations
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class MigrationExpressionBase : IMigrationExpression

    Constructors

    View Source

    MigrationExpressionBase(IMigrationContext)

    Declaration
    protected MigrationExpressionBase(IMigrationContext context)
    Parameters
    Type Name Description
    IMigrationContext context

    Properties

    View Source

    Context

    Declaration
    protected IMigrationContext Context { get; }
    Property Value
    Type Description
    IMigrationContext
    View Source

    Database

    Declaration
    protected IUmbracoDatabase Database { get; }
    Property Value
    Type Description
    IUmbracoDatabase
    View Source

    DatabaseType

    Gets the database type associated with the current migration context.

    Declaration
    public IDatabaseType DatabaseType { get; }
    Property Value
    Type Description
    IDatabaseType
    View Source

    Expressions

    Gets the collection of migration expressions that define the operations to be performed during a database migration.

    Declaration
    public List<IMigrationExpression> Expressions { get; }
    Property Value
    Type Description
    List<IMigrationExpression>
    View Source

    Logger

    Declaration
    protected ILogger Logger { get; }
    Property Value
    Type Description
    ILogger
    View Source

    SqlSyntax

    Declaration
    protected ISqlSyntaxProvider SqlSyntax { get; }
    Property Value
    Type Description
    ISqlSyntaxProvider

    Methods

    View Source

    AppendStatementSeparator(StringBuilder)

    Declaration
    protected void AppendStatementSeparator(StringBuilder stmtBuilder)
    Parameters
    Type Name Description
    StringBuilder stmtBuilder
    View Source

    Execute()

    Executes the migration expression by running the generated SQL statements and any nested expressions. Throws an exception if the expression has already been executed. Splits SQL on "GO" batch separators, logs when SQL is empty, and executes each statement. For SQLite databases, skips execution of constraint and foreign key expressions due to platform limitations. After executing its own SQL, recursively executes any child migration expressions.

    Declaration
    public virtual void Execute()
    View Source

    Execute(Sql<ISqlContext>?)

    Declaration
    protected void Execute(Sql<ISqlContext>? sql)
    Parameters
    Type Name Description
    Sql<ISqlContext> sql
    View Source

    GetQuotedValue(object?)

    Declaration
    protected string GetQuotedValue(object? val)
    Parameters
    Type Name Description
    object val
    Returns
    Type Description
    string
    View Source

    GetSql()

    Declaration
    protected virtual string? GetSql()
    Returns
    Type Description
    string
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX