Search Results for

    Show / Hide Table of Contents

    Class MigrationPlan

    Represents a migration plan.

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

    Constructors

    MigrationPlan(String)

    Initializes a new instance of the MigrationPlan class.

    Declaration
    public MigrationPlan(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the plan.

    Properties

    FinalState

    Gets the final state.

    Declaration
    public string FinalState { get; }
    Property Value
    Type Description
    System.String

    IgnoreCurrentState

    If set to true the plan executor will ignore any current state persisted and run the plan from its initial state to its end state.

    Declaration
    public virtual bool IgnoreCurrentState { get; }
    Property Value
    Type Description
    System.Boolean

    InitialState

    Gets the initial state.

    Declaration
    public virtual string InitialState { get; }
    Property Value
    Type Description
    System.String
    Remarks

    The initial state is the state when the plan has never run. By default, it is the empty string, but plans may override it if they have other ways of determining where to start from.

    Name

    Gets the name of the plan.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String

    PostMigrationTypes

    Declaration
    public IReadOnlyList<Type> PostMigrationTypes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<System.Type>

    Transitions

    Gets the transitions.

    Declaration
    public IReadOnlyDictionary<string, MigrationPlan.Transition> Transitions { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<System.String, MigrationPlan.Transition>

    Methods

    AddPostMigration<TMigration>()

    Adds a post-migration to the plan.

    Declaration
    public virtual MigrationPlan AddPostMigration<TMigration>()
        where TMigration : MigrationBase
    Returns
    Type Description
    MigrationPlan
    Type Parameters
    Name Description
    TMigration

    CreateRandomState()

    Creates a random, unique state.

    Declaration
    public virtual string CreateRandomState()
    Returns
    Type Description
    System.String

    From(String)

    Sets the starting state.

    Declaration
    public MigrationPlan From(string sourceState)
    Parameters
    Type Name Description
    System.String sourceState
    Returns
    Type Description
    MigrationPlan

    Merge()

    Begins a merge.

    Declaration
    public MergeBuilder Merge()
    Returns
    Type Description
    MergeBuilder

    ThrowOnUnknownInitialState(String)

    Throws an exception when the initial state is unknown.

    Declaration
    public virtual void ThrowOnUnknownInitialState(string state)
    Parameters
    Type Name Description
    System.String state

    To(Guid)

    Declaration
    public MigrationPlan To(Guid targetState)
    Parameters
    Type Name Description
    System.Guid targetState
    Returns
    Type Description
    MigrationPlan

    To(Guid, Type)

    Declaration
    public MigrationPlan To(Guid targetState, Type migration)
    Parameters
    Type Name Description
    System.Guid targetState
    System.Type migration
    Returns
    Type Description
    MigrationPlan

    To(String)

    Adds a transition to a target state through an empty migration.

    Declaration
    public MigrationPlan To(string targetState)
    Parameters
    Type Name Description
    System.String targetState
    Returns
    Type Description
    MigrationPlan

    To(String, Type)

    Adds a transition to a target state through a migration.

    Declaration
    public MigrationPlan To(string targetState, Type migration)
    Parameters
    Type Name Description
    System.String targetState
    System.Type migration
    Returns
    Type Description
    MigrationPlan

    To<TMigration>(Guid)

    Declaration
    public MigrationPlan To<TMigration>(Guid targetState)
        where TMigration : MigrationBase
    Parameters
    Type Name Description
    System.Guid targetState
    Returns
    Type Description
    MigrationPlan
    Type Parameters
    Name Description
    TMigration

    To<TMigration>(String)

    Adds a transition to a target state through a migration.

    Declaration
    public MigrationPlan To<TMigration>(string targetState)
        where TMigration : MigrationBase
    Parameters
    Type Name Description
    System.String targetState
    Returns
    Type Description
    MigrationPlan
    Type Parameters
    Name Description
    TMigration

    ToWithClone(String, String, String)

    Adds transitions to a target state by cloning transitions from a start state to an end state.

    Declaration
    public MigrationPlan ToWithClone(string startState, string endState, string targetState)
    Parameters
    Type Name Description
    System.String startState
    System.String endState
    System.String targetState
    Returns
    Type Description
    MigrationPlan

    ToWithReplace<TMigrationNew>(String, String)

    Adds a transition to a target state through a migration, replacing a previous migration.

    Declaration
    public MigrationPlan ToWithReplace<TMigrationNew>(string recoverState, string targetState)
        where TMigrationNew : MigrationBase
    Parameters
    Type Name Description
    System.String recoverState

    The previous target state, which we can recover from directly.

    System.String targetState

    The new target state.

    Returns
    Type Description
    MigrationPlan
    Type Parameters
    Name Description
    TMigrationNew

    The new migration.

    ToWithReplace<TMigrationNew, TMigrationRecover>(String, String)

    Adds a transition to a target state through a migration, replacing a previous migration.

    Declaration
    public MigrationPlan ToWithReplace<TMigrationNew, TMigrationRecover>(string recoverState, string targetState)
        where TMigrationNew : MigrationBase where TMigrationRecover : MigrationBase
    Parameters
    Type Name Description
    System.String recoverState

    The previous target state, which we need to recover from through TMigrationRecover.

    System.String targetState

    The new target state.

    Returns
    Type Description
    MigrationPlan
    Type Parameters
    Name Description
    TMigrationNew

    The new migration.

    TMigrationRecover

    The migration to use to recover from the previous target state.

    Validate()

    Validates the plan.

    Declaration
    public void Validate()
    In This Article
    • Constructors
      • MigrationPlan(String)
    • Properties
      • FinalState
      • IgnoreCurrentState
      • InitialState
      • Name
      • PostMigrationTypes
      • Transitions
    • Methods
      • AddPostMigration<TMigration>()
      • CreateRandomState()
      • From(String)
      • Merge()
      • ThrowOnUnknownInitialState(String)
      • To(Guid)
      • To(Guid, Type)
      • To(String)
      • To(String, Type)
      • To<TMigration>(Guid)
      • To<TMigration>(String)
      • ToWithClone(String, String, String)
      • ToWithReplace<TMigrationNew>(String, String)
      • ToWithReplace<TMigrationNew, TMigrationRecover>(String, String)
      • Validate()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX