using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WorkFlowCheck.DL.Migrations
{
    /// <inheritdoc />
    public partial class Extend018 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "RoleId",
                table: "DeviceMessage",
                type: "int",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8649), new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8652) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(264), new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(270) });

            migrationBuilder.CreateIndex(
                name: "IX_DeviceMessage_RoleId",
                table: "DeviceMessage",
                column: "RoleId");

            migrationBuilder.AddForeignKey(
                name: "FK_DeviceMessage_Roles_RoleId",
                table: "DeviceMessage",
                column: "RoleId",
                principalTable: "Roles",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_DeviceMessage_RoleId",
                table: "DeviceMessage");

            migrationBuilder.DropColumn(
                name: "RoleId",
                table: "DeviceMessage");

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(149), new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(150) });

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreatedAt", "LastModAt" },
                values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5847), new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5849) });
        }
    }
}
