Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250104151137_CWS_Daltons.cs
2025-01-04 18:49:34 +03:30

90 lines
4.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class CWS_Daltons : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "LeavePermittedDays",
table: "CustomizeWorkshopGroupSettings",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "LeavePermittedDays",
table: "CustomizeWorkshopEmployeeSettings",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "CustomizeWorkshopEmployeeSettings_CustomizeRotatingShifts",
columns: table => new
{
CustomizeWorkshopEmployeeSettingsid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_CustomizeRotatingShifts", x => new { x.CustomizeWorkshopEmployeeSettingsid, x.Id });
table.ForeignKey(
name: "FK_CustomizeWorkshopEmployeeSettings_CustomizeRotatingShifts_CustomizeWorkshopEmployeeSettings_CustomizeWorkshopEmployeeSetting~",
column: x => x.CustomizeWorkshopEmployeeSettingsid,
principalTable: "CustomizeWorkshopEmployeeSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeWorkshopGroupSettings_CustomizeRotatingShifts",
columns: table => new
{
CustomizeWorkshopGroupSettingsid = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
StartTime = table.Column<TimeOnly>(type: "time", nullable: false),
EndTime = table.Column<TimeOnly>(type: "time", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_CustomizeRotatingShifts", x => new { x.CustomizeWorkshopGroupSettingsid, x.Id });
table.ForeignKey(
name: "FK_CustomizeWorkshopGroupSettings_CustomizeRotatingShifts_CustomizeWorkshopGroupSettings_CustomizeWorkshopGroupSettingsid",
column: x => x.CustomizeWorkshopGroupSettingsid,
principalTable: "CustomizeWorkshopGroupSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomizeWorkshopEmployeeSettings_CustomizeRotatingShifts");
migrationBuilder.DropTable(
name: "CustomizeWorkshopGroupSettings_CustomizeRotatingShifts");
migrationBuilder.DropColumn(
name: "LeavePermittedDays",
table: "CustomizeWorkshopGroupSettings");
migrationBuilder.DropColumn(
name: "LeavePermittedDays",
table: "CustomizeWorkshopEmployeeSettings");
}
}
}