using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class altrProjectTeam : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProjectTeam_Projects_TeamId",
table: "ProjectTeam");
migrationBuilder.DropIndex(
name: "IX_ProjectTeam_TeamId",
table: "ProjectTeam");
migrationBuilder.DropColumn(
name: "AssignedUserId",
table: "ProjectTeam");
migrationBuilder.RenameColumn(
name: "AssignedUserName",
table: "ProjectTeam",
newName: "TeamName");
migrationBuilder.AlterColumn(
name: "TeamId",
table: "ProjectTeam",
type: "bigint",
nullable: false,
defaultValue: 0L,
oldClrType: typeof(long),
oldType: "bigint",
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_ProjectTeam_ProjectId",
table: "ProjectTeam",
column: "ProjectId");
migrationBuilder.AddForeignKey(
name: "FK_ProjectTeam_Projects_ProjectId",
table: "ProjectTeam",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProjectTeam_Projects_ProjectId",
table: "ProjectTeam");
migrationBuilder.DropIndex(
name: "IX_ProjectTeam_ProjectId",
table: "ProjectTeam");
migrationBuilder.RenameColumn(
name: "TeamName",
table: "ProjectTeam",
newName: "AssignedUserName");
migrationBuilder.AlterColumn(
name: "TeamId",
table: "ProjectTeam",
type: "bigint",
nullable: true,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AddColumn(
name: "AssignedUserId",
table: "ProjectTeam",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.CreateIndex(
name: "IX_ProjectTeam_TeamId",
table: "ProjectTeam",
column: "TeamId");
migrationBuilder.AddForeignKey(
name: "FK_ProjectTeam_Projects_TeamId",
table: "ProjectTeam",
column: "TeamId",
principalTable: "Projects",
principalColumn: "Id");
}
}
}