本文整理汇总了C#中MigrationBuilder.DropColumn方法的典型用法代码示例。如果您正苦于以下问题:C# MigrationBuilder.DropColumn方法的具体用法?C# MigrationBuilder.DropColumn怎么用?C# MigrationBuilder.DropColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MigrationBuilder
的用法示例。
在下文中一共展示了MigrationBuilder.DropColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetRoles_RoleGroups_RoleGroupId",
table: "AspNetRoles");
migrationBuilder.DropForeignKey(
name: "FK_RoleGroups_AspNetRoles_RoleId",
table: "RoleGroups");
migrationBuilder.DropIndex(
name: "IX_RoleGroups_RoleId",
table: "RoleGroups");
migrationBuilder.DropIndex(
name: "IX_AspNetRoles_RoleGroupId",
table: "AspNetRoles");
migrationBuilder.DropColumn(
name: "RoleId",
table: "RoleGroups");
migrationBuilder.DropColumn(
name: "RoleGroupId",
table: "AspNetRoles");
migrationBuilder.CreateTable(
name: "RoleRoleGroups",
columns: table => new
{
RoleId = table.Column<int>(nullable: false),
RoleGroupId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleRoleGroups", x => new { x.RoleId, x.RoleGroupId });
table.ForeignKey(
name: "FK_RoleRoleGroups_RoleGroups_RoleGroupId",
column: x => x.RoleGroupId,
principalTable: "RoleGroups",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_RoleRoleGroups_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_RoleRoleGroups_RoleGroupId",
table: "RoleRoleGroups",
column: "RoleGroupId");
migrationBuilder.CreateIndex(
name: "IX_RoleRoleGroups_RoleId",
table: "RoleRoleGroups",
column: "RoleId");
}
示例2: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_Produto_Categoria_CategoriaID", table: "Produto");
migrationBuilder.DropForeignKey(name: "FK_ProdutoVenda_Produto_ProdutoID", table: "ProdutoVenda");
migrationBuilder.DropForeignKey(name: "FK_ProdutoVenda_Venda_VendaID", table: "ProdutoVenda");
migrationBuilder.DropColumn(name: "Discriminator", table: "Usuario");
migrationBuilder.DropColumn(name: "CPF", table: "Usuario");
migrationBuilder.DropColumn(name: "CNPJ", table: "Usuario");
migrationBuilder.AddForeignKey(
name: "FK_Produto_Categoria_CategoriaID",
table: "Produto",
column: "CategoriaID",
principalTable: "Categoria",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ProdutoVenda_Produto_ProdutoID",
table: "ProdutoVenda",
column: "ProdutoID",
principalTable: "Produto",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ProdutoVenda_Venda_VendaID",
table: "ProdutoVenda",
column: "VendaID",
principalTable: "Venda",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
示例3: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(name: "IsActive", table: "Conference");
migrationBuilder.DropColumn(name: "StandardPrice", table: "Conference");
migrationBuilder.DropTable("Session");
migrationBuilder.DropTable("Speaker");
}
示例4: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_ReleaseBatchItem_ReleaseBatch_ReleaseBatchId", schema: "kraken", table: "ReleaseBatchItem");
migrationBuilder.DropForeignKey(name: "FK_ReleaseBatchLogo_ReleaseBatch_ReleaseBatchId", schema: "kraken", table: "ReleaseBatchLogo");
migrationBuilder.DropColumn(name: "IsLocked", schema: "kraken", table: "ReleaseBatch");
migrationBuilder.DropColumn(name: "LockComment", schema: "kraken", table: "ReleaseBatch");
migrationBuilder.DropColumn(name: "LockUserName", schema: "kraken", table: "ReleaseBatch");
migrationBuilder.AddForeignKey(
name: "FK_ReleaseBatchItem_ReleaseBatch_ReleaseBatchId",
schema: "kraken",
table: "ReleaseBatchItem",
column: "ReleaseBatchId",
principalSchema: "kraken",
principalTable: "ReleaseBatch",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ReleaseBatchLogo_ReleaseBatch_ReleaseBatchId",
schema: "kraken",
table: "ReleaseBatchLogo",
column: "ReleaseBatchId",
principalSchema: "kraken",
principalTable: "ReleaseBatch",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
示例5: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "FirstName",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "LastName",
table: "AspNetUsers");
migrationBuilder.DropTable(
name: "EmployeeItems");
migrationBuilder.DropTable(
name: "WarehouseItems");
migrationBuilder.DropTable(
name: "Employees");
migrationBuilder.DropTable(
name: "Items");
migrationBuilder.DropTable(
name: "Warehouses");
}
示例6: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(name: "timestamp", table: "PropertyChange");
migrationBuilder.DropColumn(name: "userGUID", table: "PropertyChange");
migrationBuilder.DropColumn(name: "timestamp", table: "ModelChange");
migrationBuilder.DropColumn(name: "userGUID", table: "ModelChange");
}
示例7: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_ApplicationUser_EFDbEvernoteCredentials_EvernoteCredentialsId", table: "AspNetUsers");
migrationBuilder.DropColumn(name: "EvernoteAuthorisedUntilDate", table: "AspNetUsers");
migrationBuilder.DropColumn(name: "EvernoteCredentialsId", table: "AspNetUsers");
migrationBuilder.DropColumn(name: "HasAuthorisedEvernote", table: "AspNetUsers");
migrationBuilder.DropTable("EFDbEvernoteCredentials");
}
示例8: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
migrationBuilder.DropColumn(name: "City", table: "AspNetUsers");
migrationBuilder.DropColumn(name: "State", table: "AspNetUsers");
migrationBuilder.DropTable("ToDo");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserLogins",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserClaims",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "RoleId",
table: "AspNetRoleClaims",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
table: "AspNetRoleClaims",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
table: "AspNetUserClaims",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
table: "AspNetUserLogins",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
table: "AspNetUserRoles",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
table: "AspNetUserRoles",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
示例9: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(name: "Headline", table: "Event");
migrationBuilder.DropColumn(name: "Headline", table: "Campaign");
migrationBuilder.AlterColumn<int>(
name: "TaskId",
table: "TaskSignup",
nullable: true);
}
示例10: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DateCreated",
table: "Locations");
migrationBuilder.DropColumn(
name: "DateModified",
table: "Locations");
}
示例11: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PreferredEmail",
table: "TaskSignup");
migrationBuilder.DropColumn(
name: "PreferredPhoneNumber",
table: "TaskSignup");
}
开发者ID:HTBox,项目名称:allReady,代码行数:10,代码来源:20160914233625_RemovePreferredEmailAndPreferredPhoneNumberFromTaskSignup.cs
示例12: Down
public override void Down(MigrationBuilder migration)
{
migration.DropColumn(name: "IDCard", table: "Member");
migration.DropColumn(name: "Sex", table: "Member");
migration.AlterColumn(
name: "ChangedPassword",
table: "AspNetUsers",
type: "bit",
nullable: false,
defaultValue: 0);
}
示例13: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_Request_Event_EventId", table: "Request");
migrationBuilder.DropColumn(name: "EventId", table: "Request");
migrationBuilder.DropColumn(name: "Latitude", table: "Request");
migrationBuilder.AddColumn<double>(
name: "Lattitude",
table: "Request",
nullable: false,
defaultValue: 0);
}
示例14: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_Session_Speaker_SpeakerID", table: "Session");
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
migrationBuilder.DropColumn(name: "Special", table: "Timeslot");
migrationBuilder.DropColumn(name: "Special", table: "Session");
migrationBuilder.AddForeignKey(
name: "FK_Session_Speaker_SpeakerID",
table: "Session",
column: "SpeakerID",
principalTable: "Speaker",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
table: "AspNetRoleClaims",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
table: "AspNetUserClaims",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
table: "AspNetUserLogins",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
table: "AspNetUserRoles",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
table: "AspNetUserRoles",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
示例15: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "WidgetData",
table: "Cms_WidgetInstance");
migrationBuilder.DropColumn(
name: "WidgetZone",
table: "Cms_WidgetInstance");
migrationBuilder.CreateTable(
name: "Cms_WidgetZone",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
Description = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Cms_WidgetZone", x => x.Id);
});
migrationBuilder.AddColumn<string>(
name: "Data",
table: "Cms_WidgetInstance",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "HtmlData",
table: "Cms_WidgetInstance",
nullable: true);
migrationBuilder.AddColumn<long>(
name: "WidgetZoneId",
table: "Cms_WidgetInstance",
nullable: false,
defaultValue: 0L);
migrationBuilder.CreateIndex(
name: "IX_Cms_WidgetInstance_WidgetZoneId",
table: "Cms_WidgetInstance",
column: "WidgetZoneId");
migrationBuilder.AddForeignKey(
name: "FK_Cms_WidgetInstance_Cms_WidgetZone_WidgetZoneId",
table: "Cms_WidgetInstance",
column: "WidgetZoneId",
principalTable: "Cms_WidgetZone",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}