using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class altrTaskHistory2 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserTaskHistories_UserTasks_UserTaskId",
table: "UserTaskHistories");
migrationBuilder.DropIndex(
name: "IX_UserTaskHistories_UserTaskId",
table: "UserTaskHistories");
migrationBuilder.DropColumn(
name: "UserTaskId",
table: "UserTaskHistories");
migrationBuilder.CreateIndex(
name: "IX_UserTaskHistories_TaskId",
table: "UserTaskHistories",
column: "TaskId");
migrationBuilder.AddForeignKey(
name: "FK_UserTaskHistories_UserTasks_TaskId",
table: "UserTaskHistories",
column: "TaskId",
principalTable: "UserTasks",
principalColumn: "Id",
onDelete: ReferentialAction.NoAction);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserTaskHistories_UserTasks_TaskId",
table: "UserTaskHistories");
migrationBuilder.DropIndex(
name: "IX_UserTaskHistories_TaskId",
table: "UserTaskHistories");
migrationBuilder.AddColumn(
name: "UserTaskId",
table: "UserTaskHistories",
type: "bigint",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_UserTaskHistories_UserTaskId",
table: "UserTaskHistories",
column: "UserTaskId");
migrationBuilder.AddForeignKey(
name: "FK_UserTaskHistories_UserTasks_UserTaskId",
table: "UserTaskHistories",
column: "UserTaskId",
principalTable: "UserTasks",
principalColumn: "Id");
}
}
}