fix(results-schema): include Language in unique constraint for CvMatchResults
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
This commit is contained in:
@@ -88,7 +88,7 @@ namespace CvMatcher.Data.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CvDocumentId", "JobDocumentId")
|
||||
b.HasIndex("CvDocumentId", "JobDocumentId", "Language")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Results", "cvMatcher");
|
||||
|
||||
Reference in New Issue
Block a user