using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PowderCoating.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class AddRefundStoreCreditLink : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "CreditMemoId",
                table: "Refunds",
                type: "int",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1509));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1518));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1521));

            migrationBuilder.CreateIndex(
                name: "IX_Refunds_CreditMemoId",
                table: "Refunds",
                column: "CreditMemoId");

            migrationBuilder.AddForeignKey(
                name: "FK_Refunds_CreditMemos_CreditMemoId",
                table: "Refunds",
                column: "CreditMemoId",
                principalTable: "CreditMemos",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Refunds_CreditMemos_CreditMemoId",
                table: "Refunds");

            migrationBuilder.DropIndex(
                name: "IX_Refunds_CreditMemoId",
                table: "Refunds");

            migrationBuilder.DropColumn(
                name: "CreditMemoId",
                table: "Refunds");

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4465));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4472));

            migrationBuilder.UpdateData(
                table: "PricingTiers",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreatedAt",
                value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4474));
        }
    }
}
