using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Baya.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class RefinementPhase3TierA : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_NurseSearchIndex_Search",
                schema: "search",
                table: "NurseSearchIndices");

            migrationBuilder.AddColumn<string>(
                name: "ConditionsJson",
                schema: "usr",
                table: "Patients",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Relation",
                schema: "usr",
                table: "Patients",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AvatarUrl",
                schema: "search",
                table: "NurseSearchIndices",
                type: "nvarchar(2048)",
                maxLength: 2048,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "NurseName",
                schema: "search",
                table: "NurseSearchIndices",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AvatarUrl",
                schema: "usr",
                table: "NurseProfiles",
                type: "nvarchar(2048)",
                maxLength: 2048,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "AvatarUrl",
                schema: "usr",
                table: "CustomerProfiles",
                type: "nvarchar(2048)",
                maxLength: 2048,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PreferredLanguage",
                schema: "usr",
                table: "CustomerProfiles",
                type: "nvarchar(10)",
                maxLength: 10,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "GeocodeSource",
                schema: "usr",
                table: "CustomerAddresses",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_NurseSearchIndex_Search",
                schema: "search",
                table: "NurseSearchIndices",
                columns: new[] { "IsSearchable", "ServiceCategoryId", "CityId", "DistrictId" })
                .Annotation("SqlServer:Include", new[] { "Price", "NurseGender", "AverageRating", "TotalReviews", "NurseId", "VariantId", "NurseName" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_NurseSearchIndex_Search",
                schema: "search",
                table: "NurseSearchIndices");

            migrationBuilder.DropColumn(
                name: "ConditionsJson",
                schema: "usr",
                table: "Patients");

            migrationBuilder.DropColumn(
                name: "Relation",
                schema: "usr",
                table: "Patients");

            migrationBuilder.DropColumn(
                name: "AvatarUrl",
                schema: "search",
                table: "NurseSearchIndices");

            migrationBuilder.DropColumn(
                name: "NurseName",
                schema: "search",
                table: "NurseSearchIndices");

            migrationBuilder.DropColumn(
                name: "AvatarUrl",
                schema: "usr",
                table: "NurseProfiles");

            migrationBuilder.DropColumn(
                name: "AvatarUrl",
                schema: "usr",
                table: "CustomerProfiles");

            migrationBuilder.DropColumn(
                name: "PreferredLanguage",
                schema: "usr",
                table: "CustomerProfiles");

            migrationBuilder.DropColumn(
                name: "GeocodeSource",
                schema: "usr",
                table: "CustomerAddresses");

            migrationBuilder.CreateIndex(
                name: "IX_NurseSearchIndex_Search",
                schema: "search",
                table: "NurseSearchIndices",
                columns: new[] { "IsSearchable", "ServiceCategoryId", "CityId", "DistrictId" })
                .Annotation("SqlServer:Include", new[] { "Price", "NurseGender", "AverageRating", "TotalReviews", "NurseId", "VariantId" });
        }
    }
}
