Handle multiline statements in migrations (#18478)

* Handle multiline statements in migrations

* Fixed failing unit tests and incorrect obsoletion.

* Fixed failing integration tests.

* Applied suggestion from code review.

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
This commit is contained in:
Andy Butland
2025-03-04 17:27:33 +01:00
committed by GitHub
parent 396b5ea211
commit 1a205d8727
3 changed files with 5 additions and 2 deletions

View File

@@ -70,6 +70,11 @@ public abstract class MigrationExpressionBase : IMigrationExpression
}
else
{
if (stmtBuilder.Length > 0)
{
stmtBuilder.Append(Environment.NewLine);
}
stmtBuilder.Append(line);
}
}

View File

@@ -92,7 +92,6 @@ public class MigrationPlanExecutor : IMigrationPlanExecutor
/// <para>Each migration in the plan, may or may not run in a scope depending on the type of plan.</para>
/// <para>A plan can complete partially, the changes of each completed migration will be saved.</para>
/// </remarks>
[Obsolete("This will return an ExecutedMigrationPlan in V13")]
public ExecutedMigrationPlan ExecutePlan(MigrationPlan plan, string fromState)
{
plan.Validate();

View File

@@ -18,7 +18,6 @@ using Umbraco.Cms.Persistence.SqlServer.Services;
using Umbraco.Cms.Tests.Common.TestHelpers;
using Umbraco.Cms.Tests.Common.Testing;
using Umbraco.Cms.Tests.Integration.Testing;
using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.SyntaxProvider;