View Source
Class MigrationPlan
Represents a migration plan.
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MigrationPlan
Constructors
View Source
MigrationPlan(String)
Declaration
public MigrationPlan(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
The name of the plan.
|
Properties
View Source
FinalState
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
Declaration
public virtual string InitialState { get; }
Property Value
Type |
Description |
System.String |
|
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
Declaration
public IReadOnlyDictionary<string, MigrationPlan.Transition> Transitions { get; }
Property Value
Methods
View Source
AddPostMigration<TMigration>()
Adds a post-migration to the plan.
Declaration
public virtual MigrationPlan AddPostMigration<TMigration>()
where TMigration : MigrationBase
Returns
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)
Declaration
public MigrationPlan From(string sourceState)
Parameters
Type |
Name |
Description |
System.String |
sourceState |
|
Returns
View Source
Merge()
Declaration
public MergeBuilder Merge()
Returns
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
View Source
To(Guid, Type)
Declaration
public MigrationPlan To(Guid targetState, Type migration)
Parameters
Type |
Name |
Description |
Guid |
targetState |
|
Type |
migration |
|
Returns
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
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
View Source
To<TMigration>(Guid)
Declaration
public MigrationPlan To<TMigration>(Guid targetState)
where TMigration : MigrationBase
Parameters
Type |
Name |
Description |
Guid |
targetState |
|
Returns
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 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
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 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 Parameters
Name |
Description |
TMigrationNew |
The new migration.
|
TMigrationRecover |
The migration to use to recover from the previous target state.
|
View Source
Validate()
Declaration