Files
mapo-core/MpDataLayer/DatabaseModels/MoonPro_STATSContext.cs
T
2021-05-15 17:02:29 +02:00

1559 lines
52 KiB
C#

using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
#nullable disable
namespace MpDataLayer.DatabaseModels
{
public partial class MoonPro_STATSContext : DbContext
{
public MoonPro_STATSContext()
{
}
public MoonPro_STATSContext(DbContextOptions<MoonPro_STATSContext> options)
: base(options)
{
}
public virtual DbSet<Aaul> Aauls { get; set; }
public virtual DbSet<Cal> Cals { get; set; }
public virtual DbSet<Config> Configs { get; set; }
public virtual DbSet<Ddb> Ddbs { get; set; }
public virtual DbSet<Ddb1> Ddbs1 { get; set; }
public virtual DbSet<DdbTurni> DdbTurnis { get; set; }
public virtual DbSet<DdbTurniNew> DdbTurniNews { get; set; }
public virtual DbSet<DdbTurniSummary> DdbTurniSummaries { get; set; }
public virtual DbSet<DdbTurniSummaryNew> DdbTurniSummaryNews { get; set; }
public virtual DbSet<Ecp> Ecps { get; set; }
public virtual DbSet<Ecp1> Ecps1 { get; set; }
public virtual DbSet<Kit> Kits { get; set; }
public virtual DbSet<Odl> Odls { get; set; }
public virtual DbSet<Odl1> Odls1 { get; set; }
public virtual DbSet<R> Rs { get; set; }
public virtual DbSet<R1> Rs1 { get; set; }
public virtual DbSet<Rc> Rcs { get; set; }
public virtual DbSet<Tally> Tallies { get; set; }
public virtual DbSet<TcStat> TcStats { get; set; }
public virtual DbSet<Tcr> Tcrs { get; set; }
public virtual DbSet<Tcr1> Tcrs1 { get; set; }
public virtual DbSet<TcrDay> TcrDays { get; set; }
public virtual DbSet<TcrDayTest> TcrDayTests { get; set; }
public virtual DbSet<TestJason> TestJasons { get; set; }
public virtual DbSet<Ul> Uls { get; set; }
public virtual DbSet<VDdb> VDdbs { get; set; }
public virtual DbSet<VDdbLight> VDdbLights { get; set; }
public virtual DbSet<VDdbLightOld> VDdbLightOlds { get; set; }
public virtual DbSet<VDdbTurni> VDdbTurnis { get; set; }
public virtual DbSet<VEcp> VEcps { get; set; }
public virtual DbSet<VEcp1> VEcps1 { get; set; }
public virtual DbSet<VEcpExtended> VEcpExtendeds { get; set; }
public virtual DbSet<VKit> VKits { get; set; }
public virtual DbSet<VOdl> VOdls { get; set; }
public virtual DbSet<VOdl1> VOdls1 { get; set; }
public virtual DbSet<VPodlNonChiusi> VPodlNonChiusis { get; set; }
public virtual DbSet<VR> VRs { get; set; }
public virtual DbSet<VR1> VRs1 { get; set; }
public virtual DbSet<VRc> VRcs { get; set; }
public virtual DbSet<VTcStat> VTcStats { get; set; }
public virtual DbSet<VTcr> VTcrs { get; set; }
public virtual DbSet<VTcr1> VTcrs1 { get; set; }
public virtual DbSet<VTcrDay> VTcrDays { get; set; }
public virtual DbSet<VUl> VUls { get; set; }
public virtual DbSet<VetoTc> VetoTcs { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<Aaul>(entity =>
{
entity.HasKey(e => e.Azione);
entity.ToTable("AAUL");
entity.Property(e => e.Azione)
.HasMaxLength(50)
.HasDefaultValueSql("('ND')")
.HasComment("Azione dell'operatore");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
});
modelBuilder.Entity<Cal>(entity =>
{
entity.HasKey(e => e.Giorno)
.HasName("PK_Calendario");
entity.ToTable("CAL");
entity.Property(e => e.Giorno)
.HasColumnType("datetime")
.HasColumnName("giorno");
entity.Property(e => e.DoDdb)
.IsRequired()
.HasColumnName("doDDB")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche derivate da DDB (DiarioDiBordo)");
entity.Property(e => e.DoEcp)
.IsRequired()
.HasColumnName("doECP")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche derivate da DPO (DatiProduzione Operatore) - conferme manuali operatore");
entity.Property(e => e.DoOdl)
.IsRequired()
.HasColumnName("doODL")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche ODL");
entity.Property(e => e.DoRs)
.IsRequired()
.HasColumnName("doRS")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche derivate da RS (Registro Scarti)");
entity.Property(e => e.DoTcr)
.IsRequired()
.HasColumnName("doTCR")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche derivate da rilevazione TCR (TempiCicloRilevati)");
entity.Property(e => e.DoUl)
.IsRequired()
.HasColumnName("doUL")
.HasDefaultValueSql("((1))")
.HasComment("Indica che è necessario ricalcolare statistiche derivate da DSO (Dichiarazioni Scarti Operatore)");
});
modelBuilder.Entity<Config>(entity =>
{
entity.HasKey(e => e.Chiave);
entity.ToTable("Config");
entity.Property(e => e.Chiave)
.HasMaxLength(50)
.HasColumnName("chiave");
entity.Property(e => e.Note).HasColumnName("note");
entity.Property(e => e.Valore).HasColumnName("valore");
entity.Property(e => e.ValoreStd)
.HasColumnName("valoreStd")
.HasComment("Valore di default/riferimento per la variabile");
});
modelBuilder.Entity<Ddb>(entity =>
{
entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.IdxStato })
.HasName("PK_DDB_1");
entity.ToTable("DDB");
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.DurataMinuti).HasColumnType("decimal(18, 8)");
});
modelBuilder.Entity<Ddb1>(entity =>
{
entity.HasNoKey();
entity.ToTable("DDB", "raw");
entity.HasIndex(e => e.InizioStato, "ci_DDB_Data")
.IsClustered();
entity.HasIndex(e => e.CodArticolo, "i_DDB_CodArt");
entity.HasIndex(e => e.IdxMacchina, "i_DDB_IdxMacc");
entity.HasIndex(e => e.IdxStato, "i_DDB_IdxStato");
entity.HasIndex(e => e.MatrOpr, "i_DDB_MatrOpr");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.FineStato).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Pallet)
.HasMaxLength(20)
.HasColumnName("pallet");
entity.Property(e => e.Value).HasMaxLength(50);
});
modelBuilder.Entity<DdbTurni>(entity =>
{
entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo });
entity.ToTable("DDB_Turni");
entity.Property(e => e.DataRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.Turno).HasMaxLength(5);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.InizioPeriodo).HasColumnType("datetime");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.DataTurnoFine).HasColumnType("datetime");
entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime");
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.FinePeriodo).HasColumnType("datetime");
entity.Property(e => e.FineStato).HasColumnType("datetime");
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Pallet)
.HasMaxLength(20)
.HasColumnName("pallet");
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
});
modelBuilder.Entity<DdbTurniNew>(entity =>
{
entity.HasKey(e => new { e.DataRif, e.IdxMacchina, e.Turno, e.IdxStato, e.CodArticolo, e.InizioPeriodo });
entity.ToTable("DDB_TurniNew");
entity.Property(e => e.DataRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.Turno).HasMaxLength(5);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.InizioPeriodo).HasColumnType("datetime");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.DataTurnoFine).HasColumnType("datetime");
entity.Property(e => e.DataTurnoInizio).HasColumnType("datetime");
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.FinePeriodo).HasColumnType("datetime");
entity.Property(e => e.FineStato).HasColumnType("datetime");
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Pallet)
.HasMaxLength(20)
.HasColumnName("pallet");
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
});
modelBuilder.Entity<DdbTurniSummary>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd });
entity.ToTable("DDB_TurniSummary");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.DataRif).HasColumnType("datetime");
entity.Property(e => e.Turno).HasMaxLength(5);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)");
entity.Property(e => e.Inizio).HasColumnType("datetime");
});
modelBuilder.Entity<DdbTurniSummaryNew>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.DataRif, e.Turno, e.CodArticolo, e.IdxStato, e.TempoCicloBase, e.PzPalletProd });
entity.ToTable("DDB_TurniSummaryNew");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.DataRif).HasColumnType("datetime");
entity.Property(e => e.Turno).HasMaxLength(5);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
entity.Property(e => e.Durata).HasColumnType("numeric(27, 7)");
entity.Property(e => e.Inizio).HasColumnType("datetime");
});
modelBuilder.Entity<Ecp>(entity =>
{
entity.HasKey(e => e.IdxEcp);
entity.ToTable("ECP");
entity.Property(e => e.IdxEcp).HasColumnName("idxECP");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.DataOraConf).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.PezziConf).HasColumnName("pezziConf");
entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav");
entity.Property(e => e.PezziScar).HasColumnName("pezziScar");
});
modelBuilder.Entity<Ecp1>(entity =>
{
entity.HasNoKey();
entity.ToTable("ECP", "raw");
entity.HasIndex(e => e.DataOraConf, "ci_ECP_Data")
.IsClustered();
entity.HasIndex(e => e.IdxMacchina, "i_ECP_IdxMacc");
entity.HasIndex(e => e.MatrApp, "i_ECP_MatrApp");
entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc");
entity.Property(e => e.CommessaEsterna)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataFrom)
.HasColumnType("datetime")
.HasColumnName("dataFrom");
entity.Property(e => e.DataOraConf).HasColumnType("datetime");
entity.Property(e => e.DataTo)
.HasColumnType("datetime")
.HasColumnName("dataTo");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.PezziConf).HasColumnName("pezziConf");
entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav");
entity.Property(e => e.PezziScar).HasColumnName("pezziScar");
});
modelBuilder.Entity<Kit>(entity =>
{
entity.HasKey(e => e.KeyKit);
entity.ToTable("KIT", "raw");
entity.Property(e => e.KeyKit).HasMaxLength(50);
entity.Property(e => e.CodArtParent).IsRequired();
entity.Property(e => e.KeyExtOrd).IsRequired();
});
modelBuilder.Entity<Odl>(entity =>
{
entity.HasKey(e => e.IdxOdl)
.HasName("PK_ODL_1");
entity.ToTable("ODL");
entity.Property(e => e.IdxOdl)
.ValueGeneratedNever()
.HasColumnName("IdxODL");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticoloParent)
.IsRequired()
.HasDefaultValueSql("('')");
entity.Property(e => e.DataFine).HasColumnType("datetime");
entity.Property(e => e.DataInizio).HasColumnType("datetime");
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50)
.HasComment("Chiave: ordine esterno o KIT");
entity.Property(e => e.KeyRichiestaParent)
.IsRequired()
.HasDefaultValueSql("('')")
.HasComment("Chiave: ordine esterno o KIT");
entity.Property(e => e.PzPallet).HasDefaultValueSql("((1))");
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
});
modelBuilder.Entity<Odl1>(entity =>
{
entity.HasKey(e => e.IdxOdl)
.IsClustered(false);
entity.ToTable("ODL", "raw");
entity.HasIndex(e => e.IdxOdl, "ci_ODL_Data")
.IsClustered();
entity.HasIndex(e => e.IdxMacchina, "i_ODL_IdxMacc");
entity.HasIndex(e => e.KeyRichiesta, "i_ODL_KeyRic");
entity.Property(e => e.IdxOdl)
.ValueGeneratedNever()
.HasColumnName("IdxODL");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CommessaAs400)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataAppr).HasColumnType("datetime");
entity.Property(e => e.DataFine).HasColumnType("datetime");
entity.Property(e => e.DataInizio).HasColumnType("datetime");
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Note).HasMaxLength(2500);
entity.Property(e => e.Provvisorio).HasColumnName("provvisorio");
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
entity.Property(e => e.TcrichAttr)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCRichAttr");
entity.Property(e => e.UserAppr).HasMaxLength(50);
});
modelBuilder.Entity<R>(entity =>
{
entity.HasKey(e => new { e.DataOraRif, e.IdxMacchina, e.Causale, e.IdxOdl });
entity.ToTable("RS");
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.Causale).HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<R1>(entity =>
{
entity.HasNoKey();
entity.ToTable("RS", "raw");
entity.HasIndex(e => e.DataOra, "ci_RS_Data")
.IsClustered();
entity.HasIndex(e => e.Causale, "i_RS_Causale");
entity.HasIndex(e => e.CodArticolo, "i_RS_CodArt");
entity.HasIndex(e => e.IdxMacchina, "i_RS_IdxMacc");
entity.HasIndex(e => e.MatrOpr, "i_RS_MatrOpr");
entity.Property(e => e.Causale)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOra).HasColumnType("datetime");
entity.Property(e => e.DataOraProdRec).HasColumnType("datetime");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<Rc>(entity =>
{
entity.HasKey(e => e.IdxControllo)
.IsClustered(false);
entity.ToTable("RC", "raw");
entity.HasIndex(e => e.DataOra, "ci_RC_Data")
.IsClustered();
entity.HasIndex(e => e.CodArticolo, "i_RC_CodArt");
entity.HasIndex(e => e.EsitoOk, "i_RC_EsitoOk");
entity.HasIndex(e => e.IdxMacchina, "i_RC_IdxMacc");
entity.HasIndex(e => e.MatrOpr, "i_RC_MatrOpr");
entity.Property(e => e.IdxControllo).ValueGeneratedNever();
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOra).HasColumnType("datetime");
entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<Tally>(entity =>
{
entity.HasKey(e => e.N)
.HasName("PK_Tally_N");
entity.ToTable("Tally");
});
modelBuilder.Entity<TcStat>(entity =>
{
entity.HasKey(e => new { e.CodArticolo, e.CodGruppo, e.IdxMacchina });
entity.ToTable("TC_Stat");
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.CodGruppo).HasMaxLength(50);
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.TcStat1)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC_Stat");
entity.Property(e => e.TcType).HasColumnName("TC_Type");
});
modelBuilder.Entity<Tcr>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif })
.IsClustered(false);
entity.ToTable("TCR");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.Tc50p)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC50p")
.HasComment("Valore percentile 50");
entity.Property(e => e.Tcmax)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMax")
.HasComment("Valore MASSIMO");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio")
.HasComment("Valore di MEDIA arimetica");
entity.Property(e => e.Tcmin)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMin")
.HasComment("Valore minimo");
});
modelBuilder.Entity<Tcr1>(entity =>
{
entity.HasNoKey();
entity.ToTable("TCR", "raw");
entity.HasIndex(e => e.DataOraRif, "ci_TCR_Data")
.IsClustered();
entity.HasIndex(e => e.CodArticolo, "i_TCR_CodArt");
entity.HasIndex(e => e.IdxMacchina, "i_TCR_IdxMacc");
entity.HasIndex(e => e.KeyRichiesta, "i_TCR_KeyRich");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio");
});
modelBuilder.Entity<TcrDay>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo, e.DataOraRif })
.HasName("PK_TCRDay")
.IsClustered(false);
entity.ToTable("TCR_Day");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("date");
entity.Property(e => e.Tc50p)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC50p")
.HasComment("Valore percentile 50");
entity.Property(e => e.Tcmax)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMax")
.HasComment("Valore MASSIMO");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio")
.HasComment("Valore di MEDIA arimetica");
entity.Property(e => e.Tcmin)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMin")
.HasComment("Valore minimo");
});
modelBuilder.Entity<TcrDayTest>(entity =>
{
entity.HasNoKey();
entity.ToTable("TCR_DayTest");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("date");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tc50p)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC50p");
entity.Property(e => e.Tcmax)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMax");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio");
entity.Property(e => e.Tcmin)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMin");
});
modelBuilder.Entity<TestJason>(entity =>
{
entity.HasNoKey();
entity.ToTable("TestJason");
entity.Property(e => e.Data).HasColumnType("date");
});
modelBuilder.Entity<Ul>(entity =>
{
entity.HasKey(e => e.IdxLog)
.HasName("PK_UserLog");
entity.ToTable("UL");
entity.HasIndex(e => e.DataOraRif, "i_UL_DataOra");
entity.Property(e => e.Azione)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('ND')")
.HasComment("Azione dell'operatore");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)");
entity.Property(e => e.Valore)
.IsRequired()
.HasMaxLength(250)
.HasDefaultValueSql("('')");
});
modelBuilder.Entity<VDdb>(entity =>
{
entity.HasNoKey();
entity.ToView("vDDB");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.FineStato).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Pallet)
.HasMaxLength(20)
.HasColumnName("pallet");
entity.Property(e => e.Value).HasMaxLength(50);
});
modelBuilder.Entity<VDdbLight>(entity =>
{
entity.HasNoKey();
entity.ToView("v_DDB_Light", "export");
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Operatore)
.IsRequired()
.HasMaxLength(101);
entity.Property(e => e.Stato).HasMaxLength(50);
});
modelBuilder.Entity<VDdbLightOld>(entity =>
{
entity.HasNoKey();
entity.ToView("vDDB_Light_OLD");
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.InizioStato).HasColumnType("datetime");
entity.Property(e => e.Operatore)
.IsRequired()
.HasMaxLength(101);
entity.Property(e => e.Stato).HasMaxLength(50);
});
modelBuilder.Entity<VDdbTurni>(entity =>
{
entity.HasNoKey();
entity.ToView("v_DDB_Turni", "export");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DataRif).HasColumnType("datetime");
entity.Property(e => e.DescClasseTempo).HasMaxLength(50);
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.Durata).HasColumnType("numeric(38, 7)");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.SemColore)
.IsRequired()
.HasMaxLength(6)
.IsUnicode(false);
entity.Property(e => e.Semaforo).HasMaxLength(50);
entity.Property(e => e.TempoCicloBase).HasColumnType("decimal(18, 8)");
entity.Property(e => e.Turno)
.IsRequired()
.HasMaxLength(5);
});
modelBuilder.Entity<VEcp>(entity =>
{
entity.HasNoKey();
entity.ToView("vECP");
entity.Property(e => e.CommessaEsterna)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataFrom)
.HasColumnType("datetime")
.HasColumnName("dataFrom");
entity.Property(e => e.DataOraConf).HasColumnType("datetime");
entity.Property(e => e.DataTo)
.HasColumnType("datetime")
.HasColumnName("dataTo");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.PezziConf).HasColumnName("pezziConf");
entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav");
entity.Property(e => e.PezziScar).HasColumnName("pezziScar");
});
modelBuilder.Entity<VEcp1>(entity =>
{
entity.HasNoKey();
entity.ToView("v_ECP", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraConf).HasColumnType("datetime");
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.IdxEcp).HasColumnName("idxECP");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.PezziConf).HasColumnName("pezziConf");
entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav");
entity.Property(e => e.PezziScar).HasColumnName("pezziScar");
});
modelBuilder.Entity<VEcpExtended>(entity =>
{
entity.HasNoKey();
entity.ToView("v_ECP_Extended", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraConf).HasColumnType("datetime");
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxEcp).HasColumnName("idxECP");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.PezziConf).HasColumnName("pezziConf");
entity.Property(e => e.PezziDaRilav).HasColumnName("pezziDaRilav");
entity.Property(e => e.PezziScar).HasColumnName("pezziScar");
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
});
modelBuilder.Entity<VKit>(entity =>
{
entity.HasNoKey();
entity.ToView("vKIT");
entity.Property(e => e.KeyKit)
.IsRequired()
.HasMaxLength(50);
});
modelBuilder.Entity<VOdl>(entity =>
{
entity.HasNoKey();
entity.ToView("vODL");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CommessaAs400)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataAppr).HasColumnType("datetime");
entity.Property(e => e.DataFine).HasColumnType("datetime");
entity.Property(e => e.DataInizio).HasColumnType("datetime");
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Note).HasMaxLength(2500);
entity.Property(e => e.Provvisorio).HasColumnName("provvisorio");
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
entity.Property(e => e.TcrichAttr)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCRichAttr");
entity.Property(e => e.UserAppr).HasMaxLength(50);
});
modelBuilder.Entity<VOdl1>(entity =>
{
entity.HasNoKey();
entity.ToView("v_ODL", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticoloParent).IsRequired();
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DataFine).HasColumnType("datetime");
entity.Property(e => e.DataInizio).HasColumnType("datetime");
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.KeyRichiestaParent).IsRequired();
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
});
modelBuilder.Entity<VPodlNonChiusi>(entity =>
{
entity.HasNoKey();
entity.ToView("v_PODL_NonChiusi", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodGruppo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataInizio).HasColumnType("datetime");
entity.Property(e => e.DescArticolo).HasMaxLength(301);
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.IdxPromessa).HasColumnName("idxPromessa");
entity.Property(e => e.KeyBcode)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("KeyBCode");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome).HasMaxLength(50);
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
entity.Property(e => e.TotMinProg).HasColumnType("decimal(29, 8)");
entity.Property(e => e.TotOreProg).HasColumnType("decimal(32, 11)");
});
modelBuilder.Entity<VR>(entity =>
{
entity.HasNoKey();
entity.ToView("vRS");
entity.Property(e => e.Causale)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOra).HasColumnType("datetime");
entity.Property(e => e.DataOraProdRec).HasColumnType("datetime");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<VR1>(entity =>
{
entity.HasNoKey();
entity.ToView("v_RS", "export");
entity.Property(e => e.Causale)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<VRc>(entity =>
{
entity.HasNoKey();
entity.ToView("vRC");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOra).HasColumnType("datetime");
entity.Property(e => e.EsitoOk).HasColumnName("EsitoOK");
entity.Property(e => e.IdxControllo).ValueGeneratedOnAdd();
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.Note)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<VTcStat>(entity =>
{
entity.HasNoKey();
entity.ToView("v_TC_Stat", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodGruppo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.TcStat)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC_Stat");
entity.Property(e => e.TcType).HasColumnName("TC_Type");
});
modelBuilder.Entity<VTcr>(entity =>
{
entity.HasNoKey();
entity.ToView("vTCR");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("IdxODL");
entity.Property(e => e.KeyRichiesta)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tcassegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio");
});
modelBuilder.Entity<VTcr1>(entity =>
{
entity.HasNoKey();
entity.ToView("v_TCR", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tc50p)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC50p");
entity.Property(e => e.Tcmax)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMax");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio");
entity.Property(e => e.Tcmin)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMin");
});
modelBuilder.Entity<VTcrDay>(entity =>
{
entity.HasNoKey();
entity.ToView("v_TCR_Day", "export");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.DescMacchina).HasMaxLength(50);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tc50p)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TC50p");
entity.Property(e => e.Tcmax)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMax");
entity.Property(e => e.Tcmedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio");
entity.Property(e => e.Tcmin)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMin");
});
modelBuilder.Entity<VUl>(entity =>
{
entity.HasNoKey();
entity.ToView("v_UL", "export");
entity.Property(e => e.Azione)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Cognome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DataOraRif).HasColumnType("datetime");
entity.Property(e => e.IdxLog).ValueGeneratedOnAdd();
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Qta).HasColumnType("decimal(18, 8)");
entity.Property(e => e.Valore)
.IsRequired()
.HasMaxLength(250);
});
modelBuilder.Entity<VetoTc>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.CodArticolo });
entity.ToTable("VetoTC");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.SogliaTc)
.HasColumnType("decimal(18, 8)")
.HasColumnName("SogliaTC");
entity.Property(e => e.VetoTc1)
.IsRequired()
.HasColumnName("VetoTC")
.HasDefaultValueSql("((1))");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}