C# 如何使用FluentMigrator删除列?
我正在使用.Net4.5和C,我正在进行一次数据库迁移。我可以使用C# 如何使用FluentMigrator删除列?,c#,migration,.net-4.5,fluent-migrator,C#,Migration,.net 4.5,Fluent Migrator,我正在使用.Net4.5和C,我正在进行一次数据库迁移。我可以使用 Alter.Table("Items").InSchema("Pricing") .AddColumn("CanBe").AsBoolean().NotNullable() 但是,我需要删除一些现有列,并且nor DeleteColumn或DropColumn方法不在IAlterTableAddColumnOrAlterColumnOrSchemaSyntax接口上 如何使用FluentMigrator
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable()
但是,我需要删除一些现有列,并且nor DeleteColumn或DropColumn方法不在IAlterTableAddColumnOrAlterColumnOrSchemaSyntax接口上
如何使用FluentMigrator删除列?我自己发现的:
它必须作为单独的声明
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable();
Delete.Column("AllowSubscription").FromTable("Items").InSchema("Pricing");
遗憾的是,Alter.Table:@Caltor中没有.DeleteColumn的选项。我认为这是因为它被“翻译”成SQL语句。如果有外键,你会怎么做?