using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PARR.DAL.Migrations
{
    /// <inheritdoc />
    public partial class TblApplicationTypesFixRel : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ApplicationTypes_ApplicationTypes_ApplicationTypeId",
                table: "ApplicationTypes");

            migrationBuilder.DropIndex(
                name: "IX_ApplicationTypes_ApplicationTypeId",
                table: "ApplicationTypes");

            migrationBuilder.DropColumn(
                name: "ApplicationTypeId",
                table: "ApplicationTypes");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "ApplicationTypeId",
                table: "ApplicationTypes",
                type: "uuid",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "ApplicationTypes",
                keyColumn: "Id",
                keyValue: new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"),
                column: "ApplicationTypeId",
                value: null);

            migrationBuilder.UpdateData(
                table: "ApplicationTypes",
                keyColumn: "Id",
                keyValue: new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"),
                column: "ApplicationTypeId",
                value: null);

            migrationBuilder.UpdateData(
                table: "ApplicationTypes",
                keyColumn: "Id",
                keyValue: new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"),
                column: "ApplicationTypeId",
                value: null);

            migrationBuilder.CreateIndex(
                name: "IX_ApplicationTypes_ApplicationTypeId",
                table: "ApplicationTypes",
                column: "ApplicationTypeId");

            migrationBuilder.AddForeignKey(
                name: "FK_ApplicationTypes_ApplicationTypes_ApplicationTypeId",
                table: "ApplicationTypes",
                column: "ApplicationTypeId",
                principalTable: "ApplicationTypes",
                principalColumn: "Id");
        }
    }
}
