06bec9b0ae
The unique constraint on cvMatcher.Results was defined as (CvDocumentId, JobDocumentId) but the code checks for (CvDocumentId, JobDocumentId, Language). This mismatch caused duplicate key violations when matching the same CV+Job in different languages. Update the constraint to (CvDocumentId, JobDocumentId, Language) to allow different languages for the same CV+Job pair while preventing true duplicates. Resolves: Duplicate key constraint violations on concurrent/repeated match requests
128 lines
4.4 KiB
C#
128 lines
4.4 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using CvMatcher.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace CvMatcher.Data.Migrations
|
|
{
|
|
[DbContext(typeof(CvMatcherDbContext))]
|
|
partial class CvMatcherDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("cvMatcher")
|
|
.HasAnnotation("ProductVersion", "10.0.7")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("CvMatcher.Data.Entities.AiPromptEntity", b =>
|
|
{
|
|
b.Property<string>("Key")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("nvarchar(128)");
|
|
|
|
b.Property<string>("Language")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("nvarchar(8)");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.ValueGeneratedOnAdd()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)")
|
|
.HasDefaultValue("");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("datetime2")
|
|
.HasDefaultValueSql("SYSUTCDATETIME()");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Key", "Language");
|
|
|
|
b.ToTable("AiPrompts", "cvMatcher");
|
|
});
|
|
|
|
modelBuilder.Entity("CvMatcher.Data.Entities.CvMatchResultEntity", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("datetime2")
|
|
.HasDefaultValueSql("SYSUTCDATETIME()");
|
|
|
|
b.Property<string>("CvDocumentId")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<string>("JobDocumentId")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ResultJson")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("Score")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CvDocumentId", "JobDocumentId", "Language")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Results", "cvMatcher");
|
|
});
|
|
|
|
modelBuilder.Entity("CvMatcher.Data.Entities.CvMatcherChatCacheEntity", b =>
|
|
{
|
|
b.Property<string>("CacheKey")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("datetime2")
|
|
.HasDefaultValueSql("SYSUTCDATETIME()");
|
|
|
|
b.Property<string>("Model")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("nvarchar(120)");
|
|
|
|
b.Property<string>("ResponseText")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal>("Temperature")
|
|
.HasColumnType("decimal(4,2)");
|
|
|
|
b.HasKey("CacheKey");
|
|
|
|
b.ToTable("ChatCache", "cvMatcher");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|