当前位置: 首页>>代码示例>>C#>>正文


C# MigrationBuilder.DropColumn方法代码示例

本文整理汇总了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");
        }
开发者ID:parys,项目名称:MyLiverpool,代码行数:60,代码来源:20160913140636_AddedRoleRoleGroupTable.cs

示例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);
 }
开发者ID:ClairtonLopesJr,项目名称:LABS,代码行数:30,代码来源:20161120012824_tiposUsuario.cs

示例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");
 }
开发者ID:jaredfaris,项目名称:OmniConf,代码行数:7,代码来源:20151105215600_AddSessions.cs

示例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);
 }
开发者ID:Zywave,项目名称:OctopusDeploy-Kraken,代码行数:26,代码来源:20160328171325_lockbatch.cs

示例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");
        }
开发者ID:andrewwb,项目名称:Warehouse_Application,代码行数:25,代码来源:20160823154143_start.cs

示例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");
 }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:7,代码来源:20151109221420_schemaMigration3.cs

示例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");
 }
开发者ID:ksk100,项目名称:EverReader,代码行数:8,代码来源:20151107154227_EvernoteAuthAdjustments.cs

示例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);
 }
开发者ID:mperrenoud,项目名称:packt,代码行数:58,代码来源:20160127111720_ToDo_NewProfileFields.cs

示例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);
 }
开发者ID:yobenzima,项目名称:allReady,代码行数:9,代码来源:20160623150301_AddingHeadlines.cs

示例10: Down

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "DateCreated",
                table: "Locations");

            migrationBuilder.DropColumn(
                name: "DateModified",
                table: "Locations");
        }
开发者ID:Roadrnr,项目名称:PtSLManager,代码行数:10,代码来源:20160706023810_AddDatesToLocation.cs

示例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);
 }
开发者ID:AntonHuang,项目名称:WebApp,代码行数:11,代码来源:20150813060458_addMember.cs

示例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);            
 }
开发者ID:codethug,项目名称:allReady,代码行数:11,代码来源:20160607185847_RequestToEventMapping.cs

示例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);
 }
开发者ID:desinole,项目名称:codecampster,代码行数:53,代码来源:20160218153246_SpecialSessionsTimeSlots.cs

示例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);
        }
开发者ID:ciker,项目名称:SimplCommerce,代码行数:53,代码来源:20160623220239_UpdateCmsWidget.cs


注:本文中的MigrationBuilder.DropColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。