44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using JSMR.Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace JSMR.Infrastructure.Data.Configuration;
|
|
|
|
public sealed class JobConfiguration : IEntityTypeConfiguration<Job>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Job> builder)
|
|
{
|
|
builder.ToTable("Jobs");
|
|
|
|
builder.HasKey(x => x.Id);
|
|
|
|
builder.Property(x => x.Code)
|
|
.HasMaxLength(100)
|
|
.IsRequired();
|
|
|
|
builder.Property(x => x.RequestedByUserId)
|
|
.HasMaxLength(100);
|
|
|
|
builder.Property(x => x.RequestedSource)
|
|
.HasMaxLength(50)
|
|
.IsRequired();
|
|
|
|
builder.Property(x => x.WorkerName)
|
|
.HasMaxLength(200);
|
|
|
|
builder.Property(x => x.CurrentStep)
|
|
.HasMaxLength(500);
|
|
|
|
builder.Property(x => x.ResultSummary)
|
|
.HasMaxLength(2000);
|
|
|
|
builder.Property(x => x.Error)
|
|
.HasColumnType("TEXT");
|
|
|
|
builder.Property(x => x.ParametersJson)
|
|
.HasColumnType("LONGTEXT");
|
|
|
|
builder.HasIndex(x => new { x.Status, x.CreatedUtc });
|
|
builder.HasIndex(x => x.Code);
|
|
}
|
|
} |