using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GerbilManagerWebAPI.Migrations
{
    /// <inheritdoc />
    public partial class UniqueExternalRef : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_Gerbils_ExternalRef",
                table: "Gerbils",
                column: "ExternalRef",
                unique: true,
                filter: "\"ExternalRef\" IS NOT NULL");
        }

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