using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class altrProjectTeams : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "Desc",
table: "Projects",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "ProjectTeam",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CreateUser = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
UpdateUser = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
CreateDate = table.Column(type: "datetime2", nullable: false),
UpdateDate = table.Column(type: "datetime2", nullable: true),
ProjectId = table.Column(type: "bigint", nullable: false),
TeamId = table.Column(type: "bigint", nullable: true),
AssignedUserId = table.Column(type: "nvarchar(max)", nullable: false),
AssignedUserName = table.Column(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProjectTeam", x => x.Id);
table.ForeignKey(
name: "FK_ProjectTeam_Projects_TeamId",
column: x => x.TeamId,
principalTable: "Projects",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_ProjectTeam_TeamId",
table: "ProjectTeam",
column: "TeamId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProjectTeam");
migrationBuilder.DropColumn(
name: "Desc",
table: "Projects");
}
}
}