38

I am using .Net4.5 and C#, I am working on one of database migrations using FluentMigrator. I am able to alter tables and add columns by using

Alter.Table("Items").InSchema("Pricing")
            .AddColumn("CanBe").AsBoolean().NotNullable()

However I need to drop some existing columns and nor DeleteColumn nor DropColumn methods are not on IAlterTableAddColumnOrAlterColumnOrSchemaSyntax interface.

How do I drop columns using FluentMigrator?

Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265

1 Answers1

69

Found it myself:

It has to go as separate statement.

Alter.Table("Items").InSchema("Pricing")
        .AddColumn("CanBe").AsBoolean().NotNullable();

Delete.Column("AllowSubscription").FromTable("Items").InSchema("Pricing");
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265