using PageFetcher.Data;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PageFetcher.Data.Migrations
{
    /// <inheritdoc />
    public partial class AddJobSearchSessionId : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "JobSearchSessionId",
                schema: MigrationConstants.SchemaName,
                table: "PageFetches",
                type: "nvarchar(64)",
                maxLength: 64,
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_PageFetches_JobSearchSessionId",
                schema: MigrationConstants.SchemaName,
                table: "PageFetches",
                column: "JobSearchSessionId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_PageFetches_JobSearchSessionId",
                schema: MigrationConstants.SchemaName,
                table: "PageFetches");

            migrationBuilder.DropColumn(
                name: "JobSearchSessionId",
                schema: MigrationConstants.SchemaName,
                table: "PageFetches");
        }
    }
}
