using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SolutionErp.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class FilterHolidayUniqueIndexByIsDeleted : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Holidays_Year_Date",
                table: "Holidays");

            migrationBuilder.CreateIndex(
                name: "IX_Holidays_Year_Date",
                table: "Holidays",
                columns: new[] { "Year", "Date" },
                unique: true,
                filter: "[IsDeleted] = 0");
        }

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

            migrationBuilder.CreateIndex(
                name: "IX_Holidays_Year_Date",
                table: "Holidays",
                columns: new[] { "Year", "Date" },
                unique: true);
        }
    }
}
