653 lines
24 KiB
C#
653 lines
24 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using DongfangHydro.Dashboard.Api.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace DongfangHydro.Dashboard.Api.Data.Migrations
|
|
{
|
|
[DbContext(typeof(DashboardDbContext))]
|
|
[Migration("20260710095939_ImportRealBom")]
|
|
partial class ImportRealBom
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.20")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.MaterialQuota", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Brand")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("Category")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<decimal?>("ConsumptionQuota")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("ConsumptionQuotaText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("MaterialCode")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("MaterialName")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<decimal?>("NetWeight")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("NetWeightText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<decimal?>("Quantity")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("QuantityText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("Remark")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)");
|
|
|
|
b.Property<int>("SourceRow")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SourceSequence")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<string>("SourceSheet")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<string>("Specification")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<string>("Unit")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("nvarchar(24)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId", "Category", "MaterialCode");
|
|
|
|
b.HasIndex("OrderId", "SourceSheet", "SourceRow")
|
|
.IsUnique();
|
|
|
|
b.ToTable("MaterialQuotas", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.Partner", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<string>("ContactName")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("ContactPhone")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("PartnerType")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Partners", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionLine", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("Owner")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("ProductionLines", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionNode", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime?>("ActualEnd")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("ActualStart")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<decimal?>("BomQuantity")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("BomQuantityText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(60)
|
|
.HasColumnType("nvarchar(60)");
|
|
|
|
b.Property<int>("CompletedQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("DefectQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("DelayDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("DelayReason")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)");
|
|
|
|
b.Property<int>("Level")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Material")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("MaterialCode")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<string>("NodeType")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("OperationCode")
|
|
.IsRequired()
|
|
.HasMaxLength(60)
|
|
.HasColumnType("nvarchar(60)");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Owner")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("nvarchar(100)");
|
|
|
|
b.Property<Guid?>("ParentNodeId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime?>("PlannedEnd")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("PlannedStart")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("Progress")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Remark")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)");
|
|
|
|
b.Property<int>("RequiredQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RiskLevel")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("SourceRow")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SourceSequence")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<string>("SourceSheet")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<string>("Specification")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<string>("StationName")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("SupplyType")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<decimal?>("TotalWeight")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("TotalWeightText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<decimal?>("UnitWeight")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("UnitWeightText")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Vendor")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("VisualKey")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId", "ParentNodeId", "SortOrder");
|
|
|
|
b.HasIndex("OrderId", "NodeType", "RiskLevel", "Status");
|
|
|
|
b.ToTable("ProductionNodes", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<int>("BatchQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<int>("CompletedQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<double>("DailyDelta")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<string>("DataSource")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<int>("DelayDays")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("DrawingProductName")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<DateTimeOffset?>("ImportedAt")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("LineId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("LineName")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("Owner")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<double>("PlanAchievement")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<DateTime?>("PlannedEnd")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("PlannedStart")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("nvarchar(200)");
|
|
|
|
b.Property<int>("Progress")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ProjectName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("nvarchar(200)");
|
|
|
|
b.Property<int>("RequiredQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RiskLevel")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("SourceDocumentCode")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("nvarchar(80)");
|
|
|
|
b.Property<string>("SourceFileHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<string>("SourceFileName")
|
|
.IsRequired()
|
|
.HasMaxLength(260)
|
|
.HasColumnType("nvarchar(260)");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("ThumbnailKey")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Code")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("LineId");
|
|
|
|
b.HasIndex("SourceDocumentCode")
|
|
.IsUnique()
|
|
.HasFilter("[SourceDocumentCode] <> ''");
|
|
|
|
b.HasIndex("Status", "RiskLevel", "PlannedEnd");
|
|
|
|
b.ToTable("ProductionOrders", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionTrendPoint", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<double>("Achievement")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("ActualQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Completion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<int>("PlannedQty")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Risk")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTimeOffset>("SampleTime")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId", "SampleTime")
|
|
.IsDescending(false, true);
|
|
|
|
b.ToTable("ProductionTrendPoints", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.RiskEvent", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("HandlingStatus")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("Message")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)");
|
|
|
|
b.Property<Guid>("NodeId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("NodeName")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("nvarchar(240)");
|
|
|
|
b.Property<DateTimeOffset>("OccurredAt")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("OrderCode")
|
|
.IsRequired()
|
|
.HasMaxLength(40)
|
|
.HasColumnType("nvarchar(40)");
|
|
|
|
b.Property<Guid>("OrderId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("RiskLevel")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId", "NodeId");
|
|
|
|
b.HasIndex("OrderId", "OccurredAt")
|
|
.IsDescending(false, true);
|
|
|
|
b.ToTable("RiskEvents", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.MaterialQuota", b =>
|
|
{
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionNode", b =>
|
|
{
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionNode", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId", "ParentNodeId")
|
|
.HasPrincipalKey("OrderId", "Id")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", b =>
|
|
{
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionLine", null)
|
|
.WithMany()
|
|
.HasForeignKey("LineId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.ProductionTrendPoint", b =>
|
|
{
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("DongfangHydro.Dashboard.Api.Domain.RiskEvent", b =>
|
|
{
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionOrder", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DongfangHydro.Dashboard.Api.Domain.ProductionNode", null)
|
|
.WithMany()
|
|
.HasForeignKey("OrderId", "NodeId")
|
|
.HasPrincipalKey("OrderId", "Id")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|