using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CalledIt.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class OptimizeLeaderboardIndex : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_UserCompetitionStats_CompetitionId_TotalPoints",
                table: "UserCompetitionStats");

            migrationBuilder.CreateIndex(
                name: "IX_UserCompetitionStats_CompetitionId_TotalPoints_UserId",
                table: "UserCompetitionStats",
                columns: new[] { "CompetitionId", "TotalPoints", "UserId" },
                descending: new[] { false, true, false });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_UserCompetitionStats_CompetitionId_TotalPoints_UserId",
                table: "UserCompetitionStats");

            migrationBuilder.CreateIndex(
                name: "IX_UserCompetitionStats_CompetitionId_TotalPoints",
                table: "UserCompetitionStats",
                columns: new[] { "CompetitionId", "TotalPoints" });
        }
    }
}
