Skip to content

Commit 893bf3e

Browse files
authored
Don't execute empty batches (#34882)
Fixes #33337
1 parent 34d9394 commit 893bf3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,8 +1453,11 @@ protected override void Generate(SqlOperation operation, IModel? model, Migratio
14531453

14541454
void AppendBatch(string batch)
14551455
{
1456-
builder.Append(batch);
1457-
EndStatement(builder, operation.SuppressTransaction);
1456+
if (!string.IsNullOrWhiteSpace(batch))
1457+
{
1458+
builder.Append(batch);
1459+
EndStatement(builder, operation.SuppressTransaction);
1460+
}
14581461
}
14591462
}
14601463

0 commit comments

Comments
 (0)