marco.pms.api/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.cs

118 lines
3.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attendrename : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendance");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
table: "Attendes");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Tenants_TenantId",
table: "Attendes");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendes",
table: "Attendes");
migrationBuilder.RenameTable(
name: "Attendes",
newName: "Attendances");
migrationBuilder.RenameIndex(
name: "IX_Attendes_TenantId",
table: "Attendances",
newName: "IX_Attendances_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendances",
newName: "IX_Attendances_EmployeeID");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendances",
table: "Attendances",
column: "Id");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "02f1b9b7-9cc5-4822-8090-362ca9b61a8e");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "b9005cdc-0d10-4110-9e42-1d7117b68cd3");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "6df40548-5543-4066-aab4-5f340015b731");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}