refactor: Rename Project to Job with enhanced model
Rename the Project concept to Job for clarity: - Add Job, JobPart, JobStock entities - JobStock supports both inventory stock and custom lengths - Add JobNumber field for job identification - Add priority-based stock allocation for cut optimization - Include Jobs UI pages (Index, Edit, Results) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
74
CutList.Web/Migrations/20260204223202_AddJobStock.cs
Normal file
74
CutList.Web/Migrations/20260204223202_AddJobStock.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CutList.Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobStock : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobStocks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobId = table.Column<int>(type: "int", nullable: false),
|
||||
MaterialId = table.Column<int>(type: "int", nullable: false),
|
||||
StockItemId = table.Column<int>(type: "int", nullable: true),
|
||||
LengthInches = table.Column<decimal>(type: "decimal(10,4)", precision: 10, scale: 4, nullable: false),
|
||||
Quantity = table.Column<int>(type: "int", nullable: false),
|
||||
IsCustomLength = table.Column<bool>(type: "bit", nullable: false),
|
||||
Priority = table.Column<int>(type: "int", nullable: false),
|
||||
SortOrder = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobStocks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobStocks_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobStocks_Materials_MaterialId",
|
||||
column: x => x.MaterialId,
|
||||
principalTable: "Materials",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobStocks_StockItems_StockItemId",
|
||||
column: x => x.StockItemId,
|
||||
principalTable: "StockItems",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobStocks_JobId",
|
||||
table: "JobStocks",
|
||||
column: "JobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobStocks_MaterialId",
|
||||
table: "JobStocks",
|
||||
column: "MaterialId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobStocks_StockItemId",
|
||||
table: "JobStocks",
|
||||
column: "StockItemId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobStocks");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user