49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CompanyManagment.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class RollCallEmployeeStatus : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "RollCallEmployeesStatus",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
RollCallEmployeeId = table.Column<long>(type: "bigint", nullable: false),
|
|
StartDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
EndDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_RollCallEmployeesStatus", x => x.id);
|
|
table.ForeignKey(
|
|
name: "FK_RollCallEmployeesStatus_RollCallEmployees_RollCallEmployeeId",
|
|
column: x => x.RollCallEmployeeId,
|
|
principalTable: "RollCallEmployees",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_RollCallEmployeesStatus_RollCallEmployeeId",
|
|
table: "RollCallEmployeesStatus",
|
|
column: "RollCallEmployeeId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "RollCallEmployeesStatus");
|
|
}
|
|
}
|
|
}
|