[성현모] CPXV2, Log DB프로젝트, DB 컨텍스트 추가

This commit is contained in:
SHM
2025-08-29 09:52:19 +09:00
parent f1d466e17c
commit 0ff4843037
50 changed files with 2999 additions and 0 deletions

View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace SystemX.Core.DB;
public partial class CPXV2Log : DbContext
{
public CPXV2Log(DbContextOptions<CPXV2Log> options)
: base(options)
{
}
public virtual DbSet<HIST_LogSummary> HIST_LogSummaries { get; set; }
public virtual DbSet<HIST_TestResult> HIST_TestResults { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<HIST_LogSummary>(entity =>
{
entity.HasKey(e => e.No);
entity.ToTable("HIST_LogSummary");
entity.HasIndex(e => new { e.TestDT, e.No }, "HIST_LogSummary_2");
entity.HasIndex(e => e.TestDT, "HIST_LogSummary_3");
entity.HasIndex(e => e.No, "UQ__HIST_Log__3214D4A98E941729").IsUnique();
entity.Property(e => e.Duration).HasMaxLength(16);
entity.Property(e => e.HostID).HasMaxLength(64);
entity.Property(e => e.ProdCode).HasMaxLength(4);
entity.Property(e => e.ProdNo_C).HasMaxLength(32);
entity.Property(e => e.ProdNo_P).HasMaxLength(32);
entity.Property(e => e.ProductID).HasMaxLength(64);
entity.Property(e => e.Result).HasMaxLength(16);
entity.Property(e => e.Section).HasMaxLength(64);
entity.Property(e => e.StationName)
.HasMaxLength(128)
.HasDefaultValue("-");
entity.Property(e => e.StepVersion).HasDefaultValue(-1);
entity.Property(e => e.TestDT).HasDefaultValueSql("(getdate())");
entity.Property(e => e.TestListCntID).HasMaxLength(256);
entity.Property(e => e.TestListFileName).HasMaxLength(256);
entity.Property(e => e.TestListFileNo).HasDefaultValue(-1);
entity.Property(e => e.TestListVariantNo).HasDefaultValue(-1);
entity.Property(e => e.TestType).HasMaxLength(8);
entity.Property(e => e.Testcode).HasMaxLength(16);
entity.Property(e => e.Version).HasMaxLength(4);
});
modelBuilder.Entity<HIST_TestResult>(entity =>
{
entity.HasKey(e => e.No);
entity.ToTable("HIST_TestResult");
entity.HasIndex(e => new { e.TestDT, e.No }, "HIST_TestResult_2");
entity.HasIndex(e => e.TestDT, "HIST_TestResult_3");
entity.Property(e => e.No).ValueGeneratedNever();
entity.Property(e => e.TestDT).HasDefaultValueSql("(getdate())");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}