Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250309154800_add employee by client tables.cs
2025-03-09 21:52:06 +03:30

76 lines
3.2 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addemployeebyclienttables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsAuthorized",
table: "Employees",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "EmployeeClientTemps",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
EmployeeFullName = table.Column<string>(type: "nvarchar(max)", nullable: true),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
EmployeeId = table.Column<long>(type: "bigint", nullable: false),
StartWorkDate = table.Column<DateTime>(type: "datetime2", nullable: false),
MaritalStatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeClientTemps", x => x.id);
});
migrationBuilder.CreateTable(
name: "LeftWorkTemps",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LeftWorkId = table.Column<long>(type: "bigint", nullable: false),
StartWork = table.Column<DateTime>(type: "datetime2", nullable: false),
LeftWork = table.Column<DateTime>(type: "datetime2", nullable: false),
LastDayStanding = table.Column<DateTime>(type: "datetime2", nullable: false),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
EmployeeId = table.Column<long>(type: "bigint", nullable: false),
JobId = table.Column<long>(type: "bigint", nullable: false),
LeftWorkType = table.Column<int>(type: "int", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LeftWorkTemps", x => x.id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EmployeeClientTemps");
migrationBuilder.DropTable(
name: "LeftWorkTemps");
migrationBuilder.DropColumn(
name: "IsAuthorized",
table: "Employees");
}
}
}