using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CouchLog.Migrations
{
    /// <inheritdoc />
    public partial class HardcodeUserWatchStatus : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_UserWatchStatuses_AspNetUsers_UserId",
                table: "UserWatchStatuses");

            migrationBuilder.DropIndex(
                name: "IX_UserWatchStatuses_UserId",
                table: "UserWatchStatuses");

            migrationBuilder.DropColumn(
                name: "UserId",
                table: "UserWatchStatuses");

            migrationBuilder.AddColumn<string>(
                name: "ApplicationUserId",
                table: "UserWatchStatuses",
                type: "TEXT",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_UserWatchStatuses_ApplicationUserId",
                table: "UserWatchStatuses",
                column: "ApplicationUserId");

            migrationBuilder.AddForeignKey(
                name: "FK_UserWatchStatuses_AspNetUsers_ApplicationUserId",
                table: "UserWatchStatuses",
                column: "ApplicationUserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_UserWatchStatuses_ApplicationUserId",
                table: "UserWatchStatuses");

            migrationBuilder.DropColumn(
                name: "ApplicationUserId",
                table: "UserWatchStatuses");

            migrationBuilder.AddColumn<string>(
                name: "UserId",
                table: "UserWatchStatuses",
                type: "TEXT",
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateIndex(
                name: "IX_UserWatchStatuses_UserId",
                table: "UserWatchStatuses",
                column: "UserId");

            migrationBuilder.AddForeignKey(
                name: "FK_UserWatchStatuses_AspNetUsers_UserId",
                table: "UserWatchStatuses",
                column: "UserId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
