/// <summary> /// Throws <see cref="NotSupportedException" /> since this operation requires table rebuilds, which /// are not yet supported. /// </summary> /// <param name="operation"> The operation. </param> /// <param name="model"> The target model which may be <c>null</c> if the operations exist without a model. </param> /// <param name="builder"> The command builder to use to build the commands. </param> /// <param name="terminate"> Indicates whether or not to terminate the command after generating SQL for the operation. </param> protected override void Generate( DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) => throw new NotSupportedException( TaosStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName()));
protected override void Generate(DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder) { throw new NotSupportedException(SqliteStrings.InvalidMigrationOperation(operation.GetType().ShortDisplayName())); }
/// <inheritdoc /> protected override void Generate(DropColumnOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (operation.IfNotExistsCheckRequired()) { throw new InvalidOperationException($"The check '{nameof(SqlServerOperationBuilderExtensions.IfNotExists)}()' is not allowed with '{operation.GetType().Name}'"); } if (!operation.IfExistsCheckRequired()) { base.Generate(operation, model, builder, terminate); return; } builder.AppendLine($"IF(COL_LENGTH('{DelimitIdentifier(operation.Table, operation.Schema)}', {GenerateSqlLiteral(operation.Name)}) IS NOT NULL)") .AppendLine("BEGIN"); using (builder.Indent()) { base.Generate(operation, model, builder, false); builder.AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator); } builder.AppendLine("END"); if (terminate) { builder.EndCommand(); } }