using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PowderCoating.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class RemoveUnusedFields : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Jobs_AspNetUsers_AssignedEmployeeId",
                table: "Jobs");

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

            migrationBuilder.DropColumn(
                name: "AIPriceRationale",
                table: "Quotes");

            migrationBuilder.DropColumn(
                name: "AISuggestedPrice",
                table: "Quotes");

            migrationBuilder.DropColumn(
                name: "UsedAISuggestion",
                table: "Quotes");

            migrationBuilder.DropColumn(
                name: "Height",
                table: "QuoteItems");

            migrationBuilder.DropColumn(
                name: "Length",
                table: "QuoteItems");

            migrationBuilder.DropColumn(
                name: "MeasurementUnit",
                table: "QuoteItems");

            migrationBuilder.DropColumn(
                name: "Width",
                table: "QuoteItems");

            migrationBuilder.DropColumn(
                name: "ActualCost",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "ActualHours",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "AssignedEmployeeId",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "CustomerApprovedDate",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "EstimatedCost",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "EstimatedHours",
                table: "Jobs");

            migrationBuilder.DropColumn(
                name: "ActualMinutes",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "Height",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "Length",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "MaterialCost",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "MeasurementUnit",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "Weight",
                table: "JobItems");

            migrationBuilder.DropColumn(
                name: "Width",
                table: "JobItems");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7815));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7821));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 13, 13, 50, 54, 482, DateTimeKind.Utc).AddTicks(7822));
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "AIPriceRationale",
                table: "Quotes",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "AISuggestedPrice",
                table: "Quotes",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "UsedAISuggestion",
                table: "Quotes",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<decimal>(
                name: "Height",
                table: "QuoteItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Length",
                table: "QuoteItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MeasurementUnit",
                table: "QuoteItems",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Width",
                table: "QuoteItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "ActualCost",
                table: "Jobs",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "ActualHours",
                table: "Jobs",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "AssignedEmployeeId",
                table: "Jobs",
                type: "nvarchar(450)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "CustomerApprovedDate",
                table: "Jobs",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "EstimatedCost",
                table: "Jobs",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<int>(
                name: "EstimatedHours",
                table: "Jobs",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ActualMinutes",
                table: "JobItems",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<decimal>(
                name: "Height",
                table: "JobItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Length",
                table: "JobItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "MaterialCost",
                table: "JobItems",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "MeasurementUnit",
                table: "JobItems",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Weight",
                table: "JobItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Width",
                table: "JobItems",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7507));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7511));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 2, 11, 19, 55, 20, 89, DateTimeKind.Utc).AddTicks(7513));

            migrationBuilder.CreateIndex(
                name: "IX_Jobs_AssignedEmployeeId",
                table: "Jobs",
                column: "AssignedEmployeeId");

            migrationBuilder.AddForeignKey(
                name: "FK_Jobs_AspNetUsers_AssignedEmployeeId",
                table: "Jobs",
                column: "AssignedEmployeeId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.SetNull);
        }
    }
}
