using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PowderCoating.Infrastructure.Migrations
{
///
public partial class AddCompanyOperatingCosts : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CompanyOperatingCosts",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CompanyId = table.Column(type: "int", nullable: false),
StandardLaborRate = table.Column(type: "decimal(18,2)", nullable: false),
OvertimeLaborRate = table.Column(type: "decimal(18,2)", nullable: false),
SpecializedLaborRate = table.Column(type: "decimal(18,2)", nullable: false),
ElectricityRatePerKwh = table.Column(type: "decimal(18,2)", nullable: false),
GasRatePerUnit = table.Column(type: "decimal(18,2)", nullable: false),
WaterRatePerUnit = table.Column(type: "decimal(18,2)", nullable: false),
OvenOperatingCostPerHour = table.Column(type: "decimal(18,2)", nullable: false),
SandblasterCostPerHour = table.Column(type: "decimal(18,2)", nullable: false),
CoatingBoothCostPerHour = table.Column(type: "decimal(18,2)", nullable: false),
GeneralMarkupPercentage = table.Column(type: "decimal(18,2)", nullable: false),
AdminOverheadPercentage = table.Column(type: "decimal(18,2)", nullable: false),
FacilityCostPercentage = table.Column(type: "decimal(18,2)", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true),
CreatedBy = table.Column(type: "nvarchar(max)", nullable: true),
UpdatedBy = table.Column(type: "nvarchar(max)", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false),
DeletedAt = table.Column(type: "datetime2", nullable: true),
DeletedBy = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CompanyOperatingCosts", x => x.Id);
table.ForeignKey(
name: "FK_CompanyOperatingCosts_Companies_CompanyId",
column: x => x.CompanyId,
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 1,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 17, 43, 30, 41, DateTimeKind.Utc).AddTicks(5021));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 2,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 17, 43, 30, 41, DateTimeKind.Utc).AddTicks(5026));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 3,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 17, 43, 30, 41, DateTimeKind.Utc).AddTicks(5028));
migrationBuilder.CreateIndex(
name: "IX_CompanyOperatingCosts_CompanyId",
table: "CompanyOperatingCosts",
column: "CompanyId",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CompanyOperatingCosts");
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 1,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 15, 0, 38, 815, DateTimeKind.Utc).AddTicks(1700));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 2,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 15, 0, 38, 815, DateTimeKind.Utc).AddTicks(1704));
migrationBuilder.UpdateData(
table: "PricingTiers",
keyColumn: "Id",
keyValue: 3,
column: "CreatedAt",
value: new DateTime(2026, 2, 6, 15, 0, 38, 815, DateTimeKind.Utc).AddTicks(1706));
}
}
}