mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 07:13:12 +00:00
Introduce in-process WeekRolled job with idempotent ledger to increment carriedOver for the SHOC board, plus optional PastDue cache and admin reprocess endpoints while keeping isPastDue derived on-read.
50 lines
2 KiB
C#
50 lines
2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Data.SeaHavenIndustries.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Phase5_DomainEvents : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "WorkOrderWeekRolledLedgers",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
WorkOrderId = table.Column<int>(type: "int", nullable: false),
|
|
SourceWeekStart = table.Column<DateOnly>(type: "date", nullable: false),
|
|
ProcessedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
CorrelationId = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_WorkOrderWeekRolledLedgers", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_WorkOrderWeekRolledLedgers_workOrders_WorkOrderId",
|
|
column: x => x.WorkOrderId,
|
|
principalTable: "workOrders",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_WorkOrderWeekRolledLedgers_WorkOrderId_SourceWeekStart",
|
|
table: "WorkOrderWeekRolledLedgers",
|
|
columns: new[] { "WorkOrderId", "SourceWeekStart" },
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "WorkOrderWeekRolledLedgers");
|
|
}
|
|
}
|
|
}
|