using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace esuite.Database.SqlServer.Migrations
{
    /// <inheritdoc />
    public partial class ChangeRoleAlternateKey : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropUniqueConstraint(
                name: "AK_Roles_DomainId_Name",
                schema: "Domain",
                table: "Roles");

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "Roles",
                keyColumn: "Id",
                keyValue: 2L,
                column: "Guid",
                value: new Guid("2f77f57c-fe2c-4a36-ad17-5d902afc86cb"));

            migrationBuilder.UpdateData(
                schema: "UserManager",
                table: "Users",
                keyColumn: "Id",
                keyValue: 1L,
                column: "Guid",
                value: new Guid("00bc6d95-2e7e-43c9-8455-d0270ca2f2d7"));

            migrationBuilder.CreateIndex(
                name: "IX_Roles_DomainId_Name",
                schema: "Domain",
                table: "Roles",
                columns: new[] { "DomainId", "Name" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Roles_DomainId_Name",
                schema: "Domain",
                table: "Roles");

            migrationBuilder.AddUniqueConstraint(
                name: "AK_Roles_DomainId_Name",
                schema: "Domain",
                table: "Roles",
                columns: new[] { "DomainId", "Name" });

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "Roles",
                keyColumn: "Id",
                keyValue: 2L,
                column: "Guid",
                value: new Guid("32d65817-4de4-4bd5-912e-2b33054a2171"));

            migrationBuilder.UpdateData(
                schema: "UserManager",
                table: "Users",
                keyColumn: "Id",
                keyValue: 1L,
                column: "Guid",
                value: new Guid("0a30fec6-bcb8-40cb-b0af-0b5ba711c8d0"));
        }
    }
}
