using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Marco.Pms.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class Added_Requested_In_Attendance_Table : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "ApprovedAt",
                table: "Attendes",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "RequestedAt",
                table: "Attendes",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "RequestedById",
                table: "Attendes",
                type: "char(36)",
                nullable: true,
                collation: "ascii_general_ci");

            migrationBuilder.CreateIndex(
                name: "IX_Attendes_RequestedById",
                table: "Attendes",
                column: "RequestedById");

            migrationBuilder.AddForeignKey(
                name: "FK_Attendes_Employees_RequestedById",
                table: "Attendes",
                column: "RequestedById",
                principalTable: "Employees",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Attendes_Employees_RequestedById",
                table: "Attendes");

            migrationBuilder.DropIndex(
                name: "IX_Attendes_RequestedById",
                table: "Attendes");

            migrationBuilder.DropColumn(
                name: "ApprovedAt",
                table: "Attendes");

            migrationBuilder.DropColumn(
                name: "RequestedAt",
                table: "Attendes");

            migrationBuilder.DropColumn(
                name: "RequestedById",
                table: "Attendes");
        }
    }
}
