Search Results for

    Show / Hide Table of Contents
    View Source

    Class MigrationBase

    Provides a base class to all migrations.

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

    Constructors

    View Source

    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

    View Source

    Alter

    Builds an Alter expression.

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

    Context

    Gets the migration context.

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

    Create

    Builds a Create expression.

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

    Database

    Gets the database instance.

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

    DatabaseType

    Gets the database type.

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

    Delete

    Builds a Delete expression.

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

    Execute

    Builds an Execute expression.

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

    Insert

    Builds an Insert expression.

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

    InvalidateBackofficeUserAccess

    If this is set to true, all backoffice client tokens will be revoked upon successful completion of the migration.

    Declaration
    public bool InvalidateBackofficeUserAccess { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Logger

    Gets the logger.

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

    RebuildCache

    If this is set to true, the published cache will be rebuild upon successful completion of the migration.

    Declaration
    public bool RebuildCache { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Rename

    Builds a Rename expression.

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

    SqlSyntax

    Gets the Sql syntax.

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

    Update

    Builds an Update expression.

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

    Methods

    View Source

    AddColumn<T>(String)

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

    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
    View Source

    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
    View Source

    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
    View Source

    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
    View Source

    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
    View Source

    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
    View Source

    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
    View Source

    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
    View Source

    CreateIndex<T>(String)

    Declaration
    protected void CreateIndex<T>(string toCreate)
    Parameters
    Type Name Description
    System.String toCreate
    Type Parameters
    Name Description
    T
    View Source

    DeleteIndex<T>(String)

    Declaration
    protected void DeleteIndex<T>(string toDelete)
    Parameters
    Type Name Description
    System.String toDelete
    Type Parameters
    Name Description
    T
    View Source

    IndexExists(String)

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

    Migrate()

    Executes the migration.

    Declaration
    protected abstract void Migrate()
    View Source

    PrimaryKeyExists(String, String)

    Declaration
    protected bool PrimaryKeyExists(string tableName, string primaryKeyName)
    Parameters
    Type Name Description
    System.String tableName
    System.String primaryKeyName
    Returns
    Type Description
    System.Boolean
    View Source

    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
    View Source

    Run()

    Runs the migration.

    Declaration
    public void Run()
    View Source

    Sql()

    Creates a new Sql statement.

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

    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>
    View Source

    TableExists(String)

    Declaration
    protected bool TableExists(string tableName)
    Parameters
    Type Name Description
    System.String tableName
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MigrationBase(IMigrationContext)
    • Properties
      • Alter
      • Context
      • Create
      • Database
      • DatabaseType
      • Delete
      • Execute
      • Insert
      • InvalidateBackofficeUserAccess
      • Logger
      • RebuildCache
      • 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)
      • CreateIndex<T>(String)
      • DeleteIndex<T>(String)
      • IndexExists(String)
      • Migrate()
      • PrimaryKeyExists(String, String)
      • ReplaceColumn<T>(String, String, String)
      • Run()
      • Sql()
      • Sql(String, Object[])
      • TableExists(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX