如何使用 FluentMigrator 删除列?
How to drop column with FluentMigrator?
我正在使用 .Net4.5
和 C#
,我正在进行其中一项数据库迁移 using FluentMigrator
。我可以使用
更改表格和添加列
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable()
但是我需要删除一些现有的列,而且 DeleteColumn
和 DropColumn
方法都不在 IAlterTableAddColumnOrAlterColumnOrSchemaSyntax
界面上。
如何使用 FluentMigrator 删除列?
自己找到的:
它必须作为单独的声明。
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable();
Delete.Column("AllowSubscription").FromTable("Items").InSchema("Pricing");
我正在使用 .Net4.5
和 C#
,我正在进行其中一项数据库迁移 using FluentMigrator
。我可以使用
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable()
但是我需要删除一些现有的列,而且 DeleteColumn
和 DropColumn
方法都不在 IAlterTableAddColumnOrAlterColumnOrSchemaSyntax
界面上。
如何使用 FluentMigrator 删除列?
自己找到的:
它必须作为单独的声明。
Alter.Table("Items").InSchema("Pricing")
.AddColumn("CanBe").AsBoolean().NotNullable();
Delete.Column("AllowSubscription").FromTable("Items").InSchema("Pricing");