using Umbraco.Cms.Infrastructure.Migrations;
namespace Umbraco.Cms.Core.Migrations;
public interface IMigrationPlanExecutor
{
///
/// Executes the migration plan.
///
/// The migration plan to execute.
/// The state to start execution at.
/// containing information about the plan execution, such as completion state and the steps that ran.
///
/// Each migration in the plan, may or may not run in a scope depending on the type of plan.
/// A plan can complete partially, the changes of each completed migration will be saved.
///
[Obsolete("Use ExecutePlanAsync instead. Scheduled for removal in Umbraco 18.")]
ExecutedMigrationPlan ExecutePlan(MigrationPlan plan, string fromState);
///
/// Executes the migration plan asynchronously.
///
/// The migration plan to execute.
/// The state to start execution at.
/// A Task of containing information about the plan execution, such as completion state and the steps that ran.
///
/// Each migration in the plan, may or may not run in a scope depending on the type of plan.
/// A plan can complete partially, the changes of each completed migration will be saved.
///
Task ExecutePlanAsync(MigrationPlan plan, string fromState)
#pragma warning disable CS0618 // Type or member is obsolete
=> Task.FromResult(ExecutePlan(plan, fromState));
#pragma warning restore CS0618 // Type or member is obsolete
}