using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WorkFlowCheck.DL.Migrations
{
    /// <inheritdoc />
    public partial class Extend007 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "DateExecution",
                table: "CheckListHeader",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "UserId",
                table: "CheckListHeader",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 21, 12, 14, 13, 195, DateTimeKind.Utc).AddTicks(5804), new DateTime(2025, 3, 21, 12, 14, 13, 195, DateTimeKind.Utc).AddTicks(5808) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 21, 12, 14, 13, 206, DateTimeKind.Utc).AddTicks(9653), new DateTime(2025, 3, 21, 12, 14, 13, 206, DateTimeKind.Utc).AddTicks(9657) });

            migrationBuilder.CreateIndex(
                name: "IX_CheckListHeader_UserId",
                table: "CheckListHeader",
                column: "UserId");

            migrationBuilder.AddForeignKey(
                name: "FK_CheckListHeader_Users_UserId",
                table: "CheckListHeader",
                column: "UserId",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

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

            migrationBuilder.DropIndex(
                name: "IX_CheckListHeader_UserId",
                table: "CheckListHeader");

            migrationBuilder.DropColumn(
                name: "DateExecution",
                table: "CheckListHeader");

            migrationBuilder.DropColumn(
                name: "UserId",
                table: "CheckListHeader");

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 21, 11, 39, 40, 269, DateTimeKind.Utc).AddTicks(5367), new DateTime(2025, 3, 21, 11, 39, 40, 269, DateTimeKind.Utc).AddTicks(5369) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 21, 11, 39, 40, 280, DateTimeKind.Utc).AddTicks(6775), new DateTime(2025, 3, 21, 11, 39, 40, 280, DateTimeKind.Utc).AddTicks(6776) });
        }
    }
}
