Files
Backend-Api/CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.cs
2025-06-02 19:47:45 +03:30

107 lines
4.6 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addoffDaystocws : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_CustomizeWorkshopEmployeeSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopEmployeeSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopGroupSettings_WeeklyOffDays_CustomizeWorkshopGroupSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopGroupSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeWorkshopSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopSettings_WeeklyOffDays_CustomizeWorkshopSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopGroupSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopSettings_WeeklyOffDays",
column: "ParentId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
migrationBuilder.DropTable(
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays");
migrationBuilder.DropTable(
name: "CustomizeWorkshopSettings_WeeklyOffDays");
}
}
}