using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

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

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

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

            migrationBuilder.DropColumn(
                name: "MaxCureTemperatureF",
                table: "Equipment");

            migrationBuilder.DropColumn(
                name: "MaxLoadWeightLbs",
                table: "Equipment");

            migrationBuilder.DropColumn(
                name: "MinCureTemperatureF",
                table: "Equipment");

            migrationBuilder.DropColumn(
                name: "Settings",
                table: "Companies");

            migrationBuilder.DropColumn(
                name: "DateOfBirth",
                table: "AspNetUsers");

            migrationBuilder.DropColumn(
                name: "HourlyRate",
                table: "AspNetUsers");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 3, 2, 22, 213, DateTimeKind.Utc).AddTicks(9898));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 3, 2, 22, 213, DateTimeKind.Utc).AddTicks(9905));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 3, 2, 22, 213, DateTimeKind.Utc).AddTicks(9908));
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "PowderInventoryId",
                table: "JobItems",
                type: "int",
                nullable: true);

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

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

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

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

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

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

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 1, 1, 30, 338, DateTimeKind.Utc).AddTicks(2335));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 1, 1, 30, 338, DateTimeKind.Utc).AddTicks(2342));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 16, 1, 1, 30, 338, DateTimeKind.Utc).AddTicks(2345));

            migrationBuilder.CreateIndex(
                name: "IX_JobItems_PowderInventoryId",
                table: "JobItems",
                column: "PowderInventoryId");

            migrationBuilder.AddForeignKey(
                name: "FK_JobItems_InventoryItems_PowderInventoryId",
                table: "JobItems",
                column: "PowderInventoryId",
                principalTable: "InventoryItems",
                principalColumn: "Id");
        }
    }
}
