using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PowderCoating.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class AddPerformanceIndexes : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_JobPhotos_JobId",
                table: "JobPhotos");

            migrationBuilder.DropIndex(
                name: "IX_JobNotes_JobId",
                table: "JobNotes");

            migrationBuilder.DropIndex(
                name: "IX_CustomerNotes_CustomerId",
                table: "CustomerNotes");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 5, 5, 35, 315, DateTimeKind.Utc).AddTicks(9644));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 5, 5, 35, 315, DateTimeKind.Utc).AddTicks(9650));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 5, 5, 35, 315, DateTimeKind.Utc).AddTicks(9652));

            migrationBuilder.CreateIndex(
                name: "IX_Quotes_CompanyId_ExpirationDate",
                table: "Quotes",
                columns: new[] { "CompanyId", "ExpirationDate" });

            migrationBuilder.CreateIndex(
                name: "IX_Quotes_CompanyId_QuoteStatusId",
                table: "Quotes",
                columns: new[] { "CompanyId", "QuoteStatusId" });

            migrationBuilder.CreateIndex(
                name: "IX_MaintenanceRecords_CompanyId_ScheduledDate",
                table: "MaintenanceRecords",
                columns: new[] { "CompanyId", "ScheduledDate" });

            migrationBuilder.CreateIndex(
                name: "IX_MaintenanceRecords_CompanyId_Status",
                table: "MaintenanceRecords",
                columns: new[] { "CompanyId", "Status" });

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_CompanyId_CustomerId",
                table: "Jobs",
                columns: new[] { "CompanyId", "CustomerId" });

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_CompanyId_DueDate",
                table: "Jobs",
                columns: new[] { "CompanyId", "DueDate" });

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_CompanyId_JobPriorityId",
                table: "Jobs",
                columns: new[] { "CompanyId", "JobPriorityId" });

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_CompanyId_JobStatusId",
                table: "Jobs",
                columns: new[] { "CompanyId", "JobStatusId" });

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_CompanyId_ScheduledDate",
                table: "Jobs",
                columns: new[] { "CompanyId", "ScheduledDate" });

            migrationBuilder.CreateIndex(
                name: "IX_JobPhotos_JobId_IsDeleted_DisplayOrder",
                table: "JobPhotos",
                columns: new[] { "JobId", "IsDeleted", "DisplayOrder" });

            migrationBuilder.CreateIndex(
                name: "IX_JobNotes_JobId_CreatedAt",
                table: "JobNotes",
                columns: new[] { "JobId", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_JobItems_JobId_IsDeleted",
                table: "JobItems",
                columns: new[] { "JobId", "IsDeleted" });

            migrationBuilder.CreateIndex(
                name: "IX_InventoryItems_CompanyId_Quantity_Reorder",
                table: "InventoryItems",
                columns: new[] { "CompanyId", "QuantityOnHand", "ReorderPoint" });

            migrationBuilder.CreateIndex(
                name: "IX_Equipment_CompanyId_Status",
                table: "Equipment",
                columns: new[] { "CompanyId", "Status" });

            migrationBuilder.CreateIndex(
                name: "IX_CustomerNotes_CustomerId_CreatedAt",
                table: "CustomerNotes",
                columns: new[] { "CustomerId", "CreatedAt" });

            migrationBuilder.CreateIndex(
                name: "IX_Appointments_CompanyId_AppointmentStatusId",
                table: "Appointments",
                columns: new[] { "CompanyId", "AppointmentStatusId" });

            migrationBuilder.CreateIndex(
                name: "IX_Appointments_CompanyId_ScheduledStartTime",
                table: "Appointments",
                columns: new[] { "CompanyId", "ScheduledStartTime" });
        }

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

            migrationBuilder.DropIndex(
                name: "IX_Quotes_CompanyId_QuoteStatusId",
                table: "Quotes");

            migrationBuilder.DropIndex(
                name: "IX_MaintenanceRecords_CompanyId_ScheduledDate",
                table: "MaintenanceRecords");

            migrationBuilder.DropIndex(
                name: "IX_MaintenanceRecords_CompanyId_Status",
                table: "MaintenanceRecords");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_CompanyId_CustomerId",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_CompanyId_DueDate",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_CompanyId_JobPriorityId",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_CompanyId_JobStatusId",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_Jobs_CompanyId_ScheduledDate",
                table: "Jobs");

            migrationBuilder.DropIndex(
                name: "IX_JobPhotos_JobId_IsDeleted_DisplayOrder",
                table: "JobPhotos");

            migrationBuilder.DropIndex(
                name: "IX_JobNotes_JobId_CreatedAt",
                table: "JobNotes");

            migrationBuilder.DropIndex(
                name: "IX_JobItems_JobId_IsDeleted",
                table: "JobItems");

            migrationBuilder.DropIndex(
                name: "IX_InventoryItems_CompanyId_Quantity_Reorder",
                table: "InventoryItems");

            migrationBuilder.DropIndex(
                name: "IX_Equipment_CompanyId_Status",
                table: "Equipment");

            migrationBuilder.DropIndex(
                name: "IX_CustomerNotes_CustomerId_CreatedAt",
                table: "CustomerNotes");

            migrationBuilder.DropIndex(
                name: "IX_Appointments_CompanyId_AppointmentStatusId",
                table: "Appointments");

            migrationBuilder.DropIndex(
                name: "IX_Appointments_CompanyId_ScheduledStartTime",
                table: "Appointments");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 0, 34, 41, 233, DateTimeKind.Utc).AddTicks(2987));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 0, 34, 41, 233, DateTimeKind.Utc).AddTicks(2995));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 15, 0, 34, 41, 233, DateTimeKind.Utc).AddTicks(2997));

            migrationBuilder.CreateIndex(
                name: "IX_JobPhotos_JobId",
                table: "JobPhotos",
                column: "JobId");

            migrationBuilder.CreateIndex(
                name: "IX_JobNotes_JobId",
                table: "JobNotes",
                column: "JobId");

            migrationBuilder.CreateIndex(
                name: "IX_CustomerNotes_CustomerId",
                table: "CustomerNotes",
                column: "CustomerId");
        }
    }
}
