[英]How to drop column with FluentMigrator?
我正在使用.Net4.5
和C#
,我正在使用FluentMigrator
進行數據庫遷移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");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.