22 lines
775 B
C#
22 lines
775 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace AVSCartonShipmentVerifier.ScanHistory;
|
|
|
|
public sealed class ScanHistoryDbContext(DbContextOptions<ScanHistoryDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<ScanHistoryEntry> ScanHistoryEntries => Set<ScanHistoryEntry>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<ScanHistoryEntry>(entity =>
|
|
{
|
|
entity.ToTable("scan_history_entries");
|
|
entity.HasKey(x => x.Id);
|
|
entity.Property(x => x.ModelNumber).HasMaxLength(128);
|
|
entity.Property(x => x.UniqueNumber).HasMaxLength(128);
|
|
entity.Property(x => x.ProcessedAtUtc);
|
|
entity.HasIndex(x => x.ProcessedAtUtc);
|
|
});
|
|
}
|
|
}
|