本文整理汇总了C#中MigrationBuilder.DropIndex方法的典型用法代码示例。如果您正苦于以下问题:C# MigrationBuilder.DropIndex方法的具体用法?C# MigrationBuilder.DropIndex怎么用?C# MigrationBuilder.DropIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MigrationBuilder
的用法示例。
在下文中一共展示了MigrationBuilder.DropIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Down
/// <summary>
/// Removes schema changes that was made by Up method.
/// </summary>
/// <param name="builder"></param>
protected override void Down(MigrationBuilder builder)
{
builder.DropIndex("MenuItemMenuIdIndex");
builder.DropTable("MenuItems");
builder.DropIndex("MenuNameIndex");
builder.DropTable("Menus");
}
示例2: 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");
}
示例3: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProductsWithMaintenance_Products_Id",
table: "ProductsWithMaintenance");
migrationBuilder.DropIndex(
name: "IX_ProductsWithMaintenance_Id",
table: "ProductsWithMaintenance");
migrationBuilder.AddColumn<int>(
name: "MaintenanceId",
table: "Products",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "ProductsWithMaintenance",
nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
migrationBuilder.CreateIndex(
name: "IX_Products_MaintenanceId",
table: "Products",
column: "MaintenanceId",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_Products_ProductsWithMaintenance_MaintenanceId",
table: "Products",
column: "MaintenanceId",
principalTable: "ProductsWithMaintenance",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
开发者ID:MvcControlsToolkit,项目名称:MvcControlsToolkit.ControlsCore,代码行数:35,代码来源:20161006101946_business4.cs
示例4: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tweets_Categories_CategoryId",
table: "Tweets");
migrationBuilder.DropIndex(
name: "IX_Tweets_CategoryId",
table: "Tweets");
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "Tweets",
nullable: false);
migrationBuilder.CreateIndex(
name: "IX_Tweets_CategoryId",
table: "Tweets",
column: "CategoryId");
migrationBuilder.AddForeignKey(
name: "FK_Tweets_Categories_CategoryId",
table: "Tweets",
column: "CategoryId",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
示例5: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Products_ProductsWithMaintenance_MaintenanceId",
table: "Products");
migrationBuilder.DropIndex(
name: "IX_Products_MaintenanceId",
table: "Products");
migrationBuilder.DropColumn(
name: "MaintenanceId",
table: "Products");
migrationBuilder.AddColumn<int>(
name: "ProductId",
table: "ProductsWithMaintenance",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_ProductsWithMaintenance_ProductId",
table: "ProductsWithMaintenance",
column: "ProductId",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_ProductsWithMaintenance_Products_ProductId",
table: "ProductsWithMaintenance",
column: "ProductId",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
开发者ID:MvcControlsToolkit,项目名称:MvcControlsToolkit.ControlsCore,代码行数:34,代码来源:20161014131620_business5.cs
示例6: Down
public override void Down(MigrationBuilder migration)
{
migration.DropIndex(name: "EmailIndex", table: "AspNetUsers");
migration.DropIndex(name: "UserNameIndex", table: "AspNetUsers");
migration.DropIndex(name: "RoleNameIndex", table: "AspNetRoles");
migration.DropTable("AirplaneModel");
migration.AlterColumn(
name: "UserName",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migration.AlterColumn(
name: "NormalizedUserName",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migration.AlterColumn(
name: "NormalizedEmail",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migration.AlterColumn(
name: "Email",
table: "AspNetUsers",
type: "nvarchar(max)",
nullable: true);
migration.AlterColumn(
name: "Id",
table: "AspNetUserClaims",
type: "int",
nullable: false);
migration.AlterColumn(
name: "Id",
table: "AspNetRoleClaims",
type: "int",
nullable: false);
migration.AlterColumn(
name: "NormalizedName",
table: "AspNetRoles",
type: "nvarchar(max)",
nullable: true);
migration.AlterColumn(
name: "Name",
table: "AspNetRoles",
type: "nvarchar(max)",
nullable: true);
}
示例7: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Submissions_Checkpoints_CheckpointId",
table: "Submissions");
migrationBuilder.DropForeignKey(
name: "FK_Submissions_Commits_CommitId",
table: "Submissions");
migrationBuilder.DropIndex(
name: "IX_Submissions_CheckpointId",
table: "Submissions");
migrationBuilder.DropIndex(
name: "IX_Submissions_CommitId",
table: "Submissions");
migrationBuilder.DropIndex(
name: "IX_Submissions_CheckpointId_CommitId_DateSubmitted",
table: "Submissions");
migrationBuilder.DropColumn(
name: "DateFeedbackRead",
table: "Submissions");
migrationBuilder.DropColumn(
name: "DateFeedbackSaved",
table: "Submissions");
migrationBuilder.DropColumn(
name: "Feedback",
table: "Submissions");
migrationBuilder.DropColumn(
name: "PullRequestNumber",
table: "Submissions");
migrationBuilder.DropTable(
name: "CheckpointDates");
migrationBuilder.AddColumn<DateTime>(
name: "DueDate",
table: "Checkpoints",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
示例8: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserQuestionData_Questions_QuestionId",
table: "UserQuestionData");
migrationBuilder.DropForeignKey(
name: "FK_UserQuestionData_Users_UserId",
table: "UserQuestionData");
migrationBuilder.DropIndex(
name: "IX_UserQuestionData_QuestionId",
table: "UserQuestionData");
migrationBuilder.DropIndex(
name: "IX_UserQuestionData_UserId",
table: "UserQuestionData");
}
示例9: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Class_ClassID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Faction_FactionID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Race_RaceID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Realm_RealmID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Region_RegionID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_BattleNetRequest_RequestID",
table: "Leaderboard");
migrationBuilder.DropForeignKey(
name: "FK_Leaderboard_Specialization_SpecID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_ClassID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_FactionID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_RaceID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_RealmID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_RegionID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_RequestID",
table: "Leaderboard");
migrationBuilder.DropIndex(
name: "IX_Leaderboard_SpecID",
table: "Leaderboard");
}
示例10: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "UserNameIndex",
table: "AspNetUsers");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName");
}
示例11: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Commits_ProjectId_UserId_Sha",
table: "Commits");
migrationBuilder.CreateIndex(
name: "IX_Commits_ProjectId_Sha",
table: "Commits",
columns: new[] { "ProjectId", "Sha" },
unique: true);
}
示例12: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_AspNetUserRoles_UserId",
table: "AspNetUserRoles");
migrationBuilder.DropIndex(
name: "RoleNameIndex",
table: "AspNetRoles");
migrationBuilder.AddColumn<DateTime>(
name: "DateValid",
table: "Products",
nullable: true);
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
}
开发者ID:MvcControlsToolkit,项目名称:MvcControlsToolkit.ControlsCore,代码行数:21,代码来源:20161218155636_business9.cs
示例13: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserCollect_Topic_TopicID",
table: "UserCollect");
migrationBuilder.DropIndex(
name: "IX_UserCollect_TopicID",
table: "UserCollect");
migrationBuilder.DropTable(
name: "Message");
}
示例14: Down
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Commits_Projects_ProjectId",
table: "Commits");
migrationBuilder.DropForeignKey(
name: "FK_Commits_Users_UserId",
table: "Commits");
migrationBuilder.DropIndex(
name: "IX_Commits_ProjectId",
table: "Commits");
migrationBuilder.DropIndex(
name: "IX_Commits_UserId",
table: "Commits");
migrationBuilder.DropColumn(
name: "DisplayName",
table: "TestClasses");
}
示例15: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Customers_Contacts_CustomerContactId",
table: "Customers");
migrationBuilder.DropIndex(
name: "IX_Customers_CustomerContactId",
table: "Customers");
migrationBuilder.DropColumn(
name: "CustomerContactId",
table: "Customers");
}