using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WorkFlowCheck.DL.Migrations
{
    /// <inheritdoc />
    public partial class Extend003 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "GuidNumber",
                table: "CheckListRow",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

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

            migrationBuilder.AddColumn<Guid>(
                name: "GuidNumber",
                table: "CheckListHeader",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 3, 15, 47, 43, 353, DateTimeKind.Utc).AddTicks(3654), new DateTime(2025, 3, 3, 15, 47, 43, 353, DateTimeKind.Utc).AddTicks(3659) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 3, 3, 15, 47, 43, 364, DateTimeKind.Utc).AddTicks(9120), new DateTime(2025, 3, 3, 15, 47, 43, 364, DateTimeKind.Utc).AddTicks(9122) });

            migrationBuilder.CreateIndex(
                name: "IX_CheckListHeader_CheckListTemplateHeaderId",
                table: "CheckListHeader",
                column: "CheckListTemplateHeaderId");

            migrationBuilder.AddForeignKey(
                name: "FK_CheckListHeader_CheckListTemplateHeader_CheckListTemplateHeaderId",
                table: "CheckListHeader",
                column: "CheckListTemplateHeaderId",
                principalTable: "CheckListTemplateHeader",
                principalColumn: "Id",
                onDelete: ReferentialAction.NoAction);
        }

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

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

            migrationBuilder.DropColumn(
                name: "GuidNumber",
                table: "CheckListRow");

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

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

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 2, 19, 12, 52, 0, 186, DateTimeKind.Utc).AddTicks(2300), new DateTime(2025, 2, 19, 12, 52, 0, 186, DateTimeKind.Utc).AddTicks(2303) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 2, 19, 12, 52, 0, 197, DateTimeKind.Utc).AddTicks(6358), new DateTime(2025, 2, 19, 12, 52, 0, 197, DateTimeKind.Utc).AddTicks(6360) });
        }
    }
}
