using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PowderCoating.Infrastructure.Migrations
{
///
public partial class AddInventoryItemAccountMapping : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "CogsAccountId",
table: "InventoryItems",
type: "int",
nullable: true);
migrationBuilder.AddColumn(
name: "InventoryAccountId",
table: "InventoryItems",
type: "int",
nullable: true);
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 1,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 32, 8, 116, DateTimeKind.Utc).AddTicks(4268));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 2,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 32, 8, 116, DateTimeKind.Utc).AddTicks(4274));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 3,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 32, 8, 116, DateTimeKind.Utc).AddTicks(4275));
migrationBuilder.CreateIndex(
name: "IX_InventoryItems_CogsAccountId",
table: "InventoryItems",
column: "CogsAccountId");
migrationBuilder.CreateIndex(
name: "IX_InventoryItems_InventoryAccountId",
table: "InventoryItems",
column: "InventoryAccountId");
migrationBuilder.AddForeignKey(
name: "FK_InventoryItems_Accounts_CogsAccountId",
table: "InventoryItems",
column: "CogsAccountId",
principalTable: "Accounts",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_InventoryItems_Accounts_InventoryAccountId",
table: "InventoryItems",
column: "InventoryAccountId",
principalTable: "Accounts",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InventoryItems_Accounts_CogsAccountId",
table: "InventoryItems");
migrationBuilder.DropForeignKey(
name: "FK_InventoryItems_Accounts_InventoryAccountId",
table: "InventoryItems");
migrationBuilder.DropIndex(
name: "IX_InventoryItems_CogsAccountId",
table: "InventoryItems");
migrationBuilder.DropIndex(
name: "IX_InventoryItems_InventoryAccountId",
table: "InventoryItems");
migrationBuilder.DropColumn(
name: "CogsAccountId",
table: "InventoryItems");
migrationBuilder.DropColumn(
name: "InventoryAccountId",
table: "InventoryItems");
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 1,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 25, 4, 485, DateTimeKind.Utc).AddTicks(8995));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 2,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 25, 4, 485, DateTimeKind.Utc).AddTicks(9001));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 3,
column: "CreatedAt",
value: new DateTime(2026, 3, 8, 3, 25, 4, 485, DateTimeKind.Utc).AddTicks(9002));
}
}
}