using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class addTaskUserTbl : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TaskUser",
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),
TaskId = table.Column(type: "bigint", nullable: false),
AssignedUserId = table.Column(type: "nvarchar(max)", nullable: false),
AssignedUserName = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskUser", x => x.Id);
table.ForeignKey(
name: "FK_TaskUser_UserTasks_TaskId",
column: x => x.TaskId,
principalTable: "UserTasks",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_TaskUser_TaskId",
table: "TaskUser",
column: "TaskId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TaskUser");
}
}
}