From 9c7807232b4ee608fe855917545a80b9b0559f45 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 19 Jul 2019 22:05:09 +0200 Subject: [PATCH] Consolidate terminate overloads in MigrationsSqlGenerator Closes #16654 --- .../Migrations/MigrationsSqlGenerator.cs | 171 ++---------------- .../SqlServerMigrationsSqlGenerator.cs | 150 +++++++-------- .../SqliteMigrationsSqlGenerator.cs | 28 ++- .../TestRelationalMigrationSqlGenerator.cs | 2 +- 4 files changed, 107 insertions(+), 244 deletions(-) diff --git a/src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs b/src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs index 6268ef2b8c7..d0419e3ad2f 100644 --- a/src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs +++ b/src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs @@ -153,19 +153,6 @@ protected virtual void Generate( generateAction(this, operation, model, builder); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] AddColumnOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -178,7 +165,7 @@ protected virtual void Generate( [NotNull] AddColumnOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -204,19 +191,6 @@ protected virtual void Generate( } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] AddForeignKeyOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -229,7 +203,7 @@ protected virtual void Generate( [NotNull] AddForeignKeyOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -248,19 +222,6 @@ protected virtual void Generate( } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] AddPrimaryKeyOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -273,7 +234,7 @@ protected virtual void Generate( [NotNull] AddPrimaryKeyOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -469,19 +430,6 @@ protected virtual void Generate( throw new NotImplementedException(); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] CreateIndexOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -494,7 +442,7 @@ protected virtual void Generate( [NotNull] CreateIndexOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -589,19 +537,6 @@ protected virtual void Generate( EndStatement(builder); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] CreateTableOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -614,7 +549,7 @@ protected virtual void Generate( [NotNull] CreateTableOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -645,19 +580,6 @@ protected virtual void Generate( } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] DropColumnOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -670,7 +592,7 @@ protected virtual void Generate( [NotNull] DropColumnOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -688,19 +610,6 @@ protected virtual void Generate( } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] DropForeignKeyOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -713,7 +622,7 @@ protected virtual void Generate( [NotNull] DropForeignKeyOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -731,25 +640,6 @@ protected virtual void Generate( } } - /// - /// - /// Can be overridden by database providers to build commands for the given - /// by making calls on the given . - /// - /// - /// Note that the default implementation of this method throws . Providers - /// must override if they are to support this kind of operation. - /// - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] DropIndexOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// /// Can be overridden by database providers to build commands for the given @@ -768,24 +658,11 @@ protected virtual void Generate( [NotNull] DropIndexOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { throw new NotImplementedException(); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] DropPrimaryKeyOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -798,7 +675,7 @@ protected virtual void Generate( [NotNull] DropPrimaryKeyOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -862,19 +739,6 @@ protected virtual void Generate( EndStatement(builder); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] DropTableOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -887,7 +751,7 @@ protected virtual void Generate( [NotNull] DropTableOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -1042,19 +906,6 @@ protected virtual void Generate( EndStatement(builder, operation.SuppressTransaction); } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected virtual void Generate( - [NotNull] InsertDataOperation operation, - [CanBeNull] IModel model, - [NotNull] MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -1067,7 +918,7 @@ protected virtual void Generate( [NotNull] InsertDataOperation operation, [CanBeNull] IModel model, [NotNull] MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); diff --git a/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs b/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs index b53cb55cd74..2c37b591f78 100644 --- a/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs +++ b/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs @@ -103,19 +103,6 @@ protected override void Generate(MigrationOperation operation, IModel model, Mig } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected override void Generate( - AddColumnOperation operation, - IModel model, - MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -153,40 +140,50 @@ protected override void Generate( /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. + /// Indicates whether or not to terminate the command after generating SQL for the operation. protected override void Generate( AddForeignKeyOperation operation, IModel model, - MigrationCommandListBuilder builder) + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + } } /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. + /// Indicates whether or not to terminate the command after generating SQL for the operation. protected override void Generate( AddPrimaryKeyOperation operation, IModel model, - MigrationCommandListBuilder builder) + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + } } /// @@ -449,15 +446,17 @@ protected override void Generate( /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. + /// Indicates whether or not to terminate the command after generating SQL for the operation. protected override void Generate( CreateTableOperation operation, IModel model, - MigrationCommandListBuilder builder) + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); @@ -475,9 +474,12 @@ protected override void Generate( } } - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: memoryOptimized); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: memoryOptimized); + } } /// @@ -519,33 +521,28 @@ protected override void Generate( /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropTableOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate( + DropTableOperation operation, + IModel model, + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Name)); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Name)); + } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected override void Generate( - CreateIndexOperation operation, - IModel model, - MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -558,7 +555,7 @@ protected override void Generate( CreateIndexOperation operation, IModel model, MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -633,21 +630,26 @@ protected override void Generate( /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. + /// Indicates whether or not to terminate the command after generating SQL for the operation. protected override void Generate( DropPrimaryKeyOperation operation, IModel model, - MigrationCommandListBuilder builder) + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + } } /// @@ -961,18 +963,26 @@ protected override void Generate(AlterTableOperation operation, IModel model, Mi /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropForeignKeyOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate( + DropForeignKeyOperation operation, + IModel model, + MigrationCommandListBuilder builder, + bool terminate = true) { base.Generate(operation, model, builder, terminate: false); - builder - .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) - .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + if (terminate) + { + builder + .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator) + .EndCommand(suppressTransaction: IsMemoryOptimized(operation, model, operation.Schema, operation.Table)); + } } /// @@ -1018,19 +1028,6 @@ protected override void Generate( } } - /// - /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. - /// - /// The operation. - /// The target model which may be null if the operations exist without a model. - /// The command builder to use to build the commands. - protected override void Generate( - DropColumnOperation operation, - IModel model, - MigrationCommandListBuilder builder) - => Generate(operation, model, builder, terminate: true); - /// /// Builds commands for the given by making calls on the given /// . @@ -1043,7 +1040,7 @@ protected override void Generate( DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder, - bool terminate) + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -1144,15 +1141,17 @@ protected override void Generate(SqlOperation operation, IModel model, Migration /// /// Builds commands for the given by making calls on the given - /// , and then terminates the final command. + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. + /// Indicates whether or not to terminate the command after generating SQL for the operation. protected override void Generate( InsertDataOperation operation, IModel model, - MigrationCommandListBuilder builder) + MigrationCommandListBuilder builder, + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -1169,7 +1168,10 @@ protected override void Generate( GenerateIdentityInsert(builder, operation, on: false); - builder.EndCommand(); + if (terminate) + { + builder.EndCommand(); + } } private void GenerateIdentityInsert(MigrationCommandListBuilder builder, InsertDataOperation operation, bool on) diff --git a/src/EFCore.Sqlite.Core/Migrations/SqliteMigrationsSqlGenerator.cs b/src/EFCore.Sqlite.Core/Migrations/SqliteMigrationsSqlGenerator.cs index e3d74512ad8..9c91131ebb3 100644 --- a/src/EFCore.Sqlite.Core/Migrations/SqliteMigrationsSqlGenerator.cs +++ b/src/EFCore.Sqlite.Core/Migrations/SqliteMigrationsSqlGenerator.cs @@ -312,13 +312,18 @@ protected override void Generate(RenameColumnOperation operation, IModel model, } /// - /// Builds commands for the given - /// by making calls on the given . + /// Builds commands for the given by making calls on the given + /// . /// /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(CreateTableOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate( + CreateTableOperation operation, + IModel model, + MigrationCommandListBuilder builder, + bool terminate = true) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); @@ -340,7 +345,7 @@ protected override void Generate(CreateTableOperation operation, IModel model, M } } - base.Generate(operation, model, builder); + base.Generate(operation, model, builder, terminate); } /// @@ -394,7 +399,8 @@ protected override void ColumnDefinition( /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(AddForeignKeyOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate(AddForeignKeyOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); @@ -405,7 +411,8 @@ protected override void Generate(AddForeignKeyOperation operation, IModel model, /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(AddPrimaryKeyOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate(AddPrimaryKeyOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); @@ -438,7 +445,8 @@ protected override void Generate(CreateCheckConstraintOperation operation, IMode /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate(DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); @@ -449,7 +457,8 @@ protected override void Generate(DropColumnOperation operation, IModel model, Mi /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropForeignKeyOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate(DropForeignKeyOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); @@ -460,7 +469,8 @@ protected override void Generate(DropForeignKeyOperation operation, IModel model /// The operation. /// The target model which may be null if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropPrimaryKeyOperation operation, IModel model, MigrationCommandListBuilder builder) + /// Indicates whether or not to terminate the command after generating SQL for the operation. + protected override void Generate(DropPrimaryKeyOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); diff --git a/test/EFCore.Relational.Tests/TestUtilities/TestRelationalMigrationSqlGenerator.cs b/test/EFCore.Relational.Tests/TestUtilities/TestRelationalMigrationSqlGenerator.cs index fdc916dc395..4e10366ee5a 100644 --- a/test/EFCore.Relational.Tests/TestUtilities/TestRelationalMigrationSqlGenerator.cs +++ b/test/EFCore.Relational.Tests/TestUtilities/TestRelationalMigrationSqlGenerator.cs @@ -18,7 +18,7 @@ protected override void Generate(RenameTableOperation operation, IModel model, M { } - protected override void Generate(DropIndexOperation operation, IModel model, MigrationCommandListBuilder builder) + protected override void Generate(DropIndexOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) { }