using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MaBibli.Api.Data.Migrations
{
    /// <inheritdoc />
    public partial class IndexPretEnCours : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_Prets_LivreId_EnCours",
                table: "Prets",
                column: "LivreId",
                unique: true,
                filter: "\"DateRetour\" IS NULL");
        }

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