Search Results for

    Show / Hide Table of Contents
    View Source

    Class MigrationPlan

    Represents a migration plan.

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

    Constructors

    View Source

    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

    View Source

    FinalState

    Gets the final state.

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

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

    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.

    View Source

    Name

    Gets the name of the plan.

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

    PostMigrationTypes

    Declaration
    public IReadOnlyList<Type> PostMigrationTypes { get; }
    Property Value
    Type Description
    IReadOnlyList<Type>
    View Source

    Transitions

    Gets the transitions.

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

    Methods

    View Source

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

    CreateRandomState()

    Creates a random, unique state.

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

    From(String)

    Sets the starting state.

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

    Merge()

    Begins a merge.

    Declaration
    public MergeBuilder Merge()
    Returns
    Type Description
    MergeBuilder
    View Source

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

    To(Guid)

    Declaration
    public MigrationPlan To(Guid targetState)
    Parameters
    Type Name Description
    Guid targetState
    Returns
    Type Description
    MigrationPlan
    View Source

    To(Guid, Type)

    Declaration
    public MigrationPlan To(Guid targetState, Type migration)
    Parameters
    Type Name Description
    Guid targetState
    Type migration
    Returns
    Type Description
    MigrationPlan
    View Source

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

    To(String, Nullable<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.Nullable<Type> migration
    Returns
    Type Description
    MigrationPlan
    View Source

    To<TMigration>(Guid)

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

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

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

    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.

    View Source

    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.

    View Source

    Validate()

    Validates the plan.

    Declaration
    public void Validate()
    • Improve this Doc
    • View Source
    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, Nullable<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