using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WorkFlowCheck.DL.Migrations
{
    /// <inheritdoc />
    public partial class Extend014 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "DeviceMessage",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SendDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ReceiveDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeviceIdFrom = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DeviceIdTo = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    Message = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ExtraDataJSON = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsReaded = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeviceMessage", x => x.Id);
                });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1707), new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1709) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6682), new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6683) });

            migrationBuilder.CreateIndex(
                name: "IX_DeviceMessage_DeviceIdTo",
                table: "DeviceMessage",
                column: "DeviceIdTo");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DeviceMessage");

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578), new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896), new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897) });
        }
    }
}
