Search Results for

    Show / Hide Table of Contents

    Class MigrationBase

    Provides a base class to all migrations.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Infrastructure.Migrations
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class MigrationBase : IDiscoverable

    Constructors

    MigrationBase(IMigrationContext)

    Initializes a new instance of the MigrationBase class.

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

    A migration context.

    Properties

    Alter

    Builds an Alter expression.

    Declaration
    public IAlterBuilder Alter { get; }
    Property Value
    Type Description
    IAlterBuilder

    Context

    Gets the migration context.

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

    Create

    Builds a Create expression.

    Declaration
    public ICreateBuilder Create { get; }
    Property Value
    Type Description
    ICreateBuilder

    Database

    Gets the database instance.

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

    DatabaseType

    Gets the database type.

    Declaration
    protected DatabaseType DatabaseType { get; }
    Property Value
    Type Description
    DatabaseType

    Delete

    Builds a Delete expression.

    Declaration
    public IDeleteBuilder Delete { get; }
    Property Value
    Type Description
    IDeleteBuilder

    Execute

    Builds an Execute expression.

    Declaration
    public IExecuteBuilder Execute { get; }
    Property Value
    Type Description
    IExecuteBuilder

    Insert

    Builds an Insert expression.

    Declaration
    public IInsertBuilder Insert { get; }
    Property Value
    Type Description
    IInsertBuilder

    Logger

    Gets the logger.

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

    Rename

    Builds a Rename expression.

    Declaration
    public IRenameBuilder Rename { get; }
    Property Value
    Type Description
    IRenameBuilder

    SqlSyntax

    Gets the Sql syntax.

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

    Update

    Builds an Update expression.

    Declaration
    public IUpdateBuilder Update { get; }
    Property Value
    Type Description
    IUpdateBuilder

    Methods

    AddColumn<T>(String)

    Declaration
    protected void AddColumn<T>(string columnName)
    Parameters
    Type Name Description
    System.String columnName
    Type Parameters
    Name Description
    T

    AddColumn<T>(String, out IEnumerable<String>)

    Declaration
    protected void AddColumn<T>(string columnName, out IEnumerable<string> sqls)
    Parameters
    Type Name Description
    System.String columnName
    System.Collections.Generic.IEnumerable<System.String> sqls
    Type Parameters
    Name Description
    T

    AddColumn<T>(String, String)

    Declaration
    protected void AddColumn<T>(string tableName, string columnName)
    Parameters
    Type Name Description
    System.String tableName
    System.String columnName
    Type Parameters
    Name Description
    T

    AddColumn<T>(String, String, out IEnumerable<String>)

    Declaration
    protected void AddColumn<T>(string tableName, string columnName, out IEnumerable<string> sqls)
    Parameters
    Type Name Description
    System.String tableName
    System.String columnName
    System.Collections.Generic.IEnumerable<System.String> sqls
    Type Parameters
    Name Description
    T

    AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String)

    Declaration
    protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string columnName)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<ColumnInfo> columns
    System.String columnName
    Type Parameters
    Name Description
    T

    AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String, String)

    Declaration
    protected void AddColumnIfNotExists<T>(IEnumerable<ColumnInfo> columns, string tableName, string columnName)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<ColumnInfo> columns
    System.String tableName
    System.String columnName
    Type Parameters
    Name Description
    T

    AlterColumn<T>(String, String)

    Declaration
    protected void AlterColumn<T>(string tableName, string columnName)
    Parameters
    Type Name Description
    System.String tableName
    System.String columnName
    Type Parameters
    Name Description
    T

    ColumnExists(String, String)

    Declaration
    protected bool ColumnExists(string tableName, string columnName)
    Parameters
    Type Name Description
    System.String tableName
    System.String columnName
    Returns
    Type Description
    System.Boolean

    ColumnType(String, String)

    Declaration
    protected string ColumnType(string tableName, string columnName)
    Parameters
    Type Name Description
    System.String tableName
    System.String columnName
    Returns
    Type Description
    System.String

    IndexExists(String)

    Declaration
    protected bool IndexExists(string indexName)
    Parameters
    Type Name Description
    System.String indexName
    Returns
    Type Description
    System.Boolean

    Migrate()

    Executes the migration.

    Declaration
    protected abstract void Migrate()

    ReplaceColumn<T>(String, String, String)

    Declaration
    protected void ReplaceColumn<T>(string tableName, string currentName, string newName)
    Parameters
    Type Name Description
    System.String tableName
    System.String currentName
    System.String newName
    Type Parameters
    Name Description
    T

    Run()

    Runs the migration.

    Declaration
    public void Run()

    Sql()

    Creates a new Sql statement.

    Declaration
    protected Sql<ISqlContext> Sql()
    Returns
    Type Description
    Sql<ISqlContext>

    Sql(String, Object[])

    Creates a new Sql statement with arguments.

    Declaration
    protected Sql<ISqlContext> Sql(string sql, params object[] args)
    Parameters
    Type Name Description
    System.String sql
    System.Object[] args
    Returns
    Type Description
    Sql<ISqlContext>

    TableExists(String)

    Declaration
    protected bool TableExists(string tableName)
    Parameters
    Type Name Description
    System.String tableName
    Returns
    Type Description
    System.Boolean
    In This Article
    • Constructors
      • MigrationBase(IMigrationContext)
    • Properties
      • Alter
      • Context
      • Create
      • Database
      • DatabaseType
      • Delete
      • Execute
      • Insert
      • Logger
      • Rename
      • SqlSyntax
      • Update
    • Methods
      • AddColumn<T>(String)
      • AddColumn<T>(String, out IEnumerable<String>)
      • AddColumn<T>(String, String)
      • AddColumn<T>(String, String, out IEnumerable<String>)
      • AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String)
      • AddColumnIfNotExists<T>(IEnumerable<ColumnInfo>, String, String)
      • AlterColumn<T>(String, String)
      • ColumnExists(String, String)
      • ColumnType(String, String)
      • IndexExists(String)
      • Migrate()
      • ReplaceColumn<T>(String, String, String)
      • Run()
      • Sql()
      • Sql(String, Object[])
      • TableExists(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX