Skip to content

Commit 1a205d8

Browse files
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 <[email protected]>
1 parent 396b5ea commit 1a205d8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/Umbraco.Infrastructure/Migrations/MigrationExpressionBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public virtual void Execute()
7070
}
7171
else
7272
{
73+
if (stmtBuilder.Length > 0)
74+
{
75+
stmtBuilder.Append(Environment.NewLine);
76+
}
77+
7378
stmtBuilder.Append(line);
7479
}
7580
}

src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public MigrationPlanExecutor(
9292
/// <para>Each migration in the plan, may or may not run in a scope depending on the type of plan.</para>
9393
/// <para>A plan can complete partially, the changes of each completed migration will be saved.</para>
9494
/// </remarks>
95-
[Obsolete("This will return an ExecutedMigrationPlan in V13")]
9695
public ExecutedMigrationPlan ExecutePlan(MigrationPlan plan, string fromState)
9796
{
9897
plan.Validate();

tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using Umbraco.Cms.Tests.Common.TestHelpers;
1919
using Umbraco.Cms.Tests.Common.Testing;
2020
using Umbraco.Cms.Tests.Integration.Testing;
21-
using Umbraco.Extensions;
2221

2322
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.SyntaxProvider;
2423

0 commit comments

Comments
 (0)