Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions RikiPath.Infrastructure/Configuration/ContentPassageConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public void Configure(EntityTypeBuilder<ContentPassage> builder)
builder.Property(x => x.SourceReference).HasMaxLength(300);
builder.Property(x => x.AiProvenanceJson).HasColumnType("jsonb");
builder.Property(x => x.ContentFingerprint).IsRequired().HasMaxLength(64);
// Retain legacy publication columns created by the canonical migrations.
// Review state now lives in ContentApprovalRequests/ContentBankItems.
builder.Property<int>("PublishStatus");
builder.Property<DateTime?>("PublishedAt").HasColumnType("timestamp without time zone");

// ContentPassage chỉ có hai quan hệ:
// MockTestSection (1) -> ContentPassage (N),
// ContentPassage (1) -> MockQuestion (N).
Expand Down
19 changes: 0 additions & 19 deletions RikiPath.Infrastructure/Configuration/MockQuestionConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,6 @@ public void Configure(EntityTypeBuilder<MockQuestion> builder)
builder.Property(x => x.Topic).HasMaxLength(150);
builder.Property(x => x.MockTestSectionId).HasColumnName("PracticeTestSectionId");
builder.Property(x => x.AudioTranscript).HasColumnType("text");
// These legacy columns and relationships still exist in the migration chain.
// Keep them mapped while the active review data is stored in ContentBankItems.
builder.Property<int>("CertificateLevelId");
builder.Property<int>("LanguageSkillId");
builder.Property<int>("PublishStatus");
builder.Property<DateTime?>("PublishedAt").HasColumnType("timestamp without time zone");
builder.Property<string>("RightsStatus").HasMaxLength(100);
builder.Property<int?>("SourceQuestionId");

builder.HasOne<CertificateLevel>().WithMany()
.HasForeignKey("CertificateLevelId").OnDelete(DeleteBehavior.Restrict).IsRequired();
builder.HasOne<LanguageSkill>().WithMany()
.HasForeignKey("LanguageSkillId").OnDelete(DeleteBehavior.Restrict).IsRequired();
builder.HasOne<MockQuestion>().WithMany()
.HasForeignKey("SourceQuestionId").OnDelete(DeleteBehavior.SetNull);

builder.HasOne(x => x.Passage)
.WithMany(x => x.Questions)
.HasForeignKey(x => x.PassageId)
Expand All @@ -56,9 +40,6 @@ public void Configure(EntityTypeBuilder<MockQuestion> builder)

builder.HasIndex(x => x.QuestionIdentity);
builder.HasIndex(x => x.ContentFingerprint);
builder.HasIndex("LanguageSkillId");
builder.HasIndex("SourceQuestionId");
builder.HasIndex("CertificateLevelId", "LanguageSkillId", "PublishStatus", "IsArchivedVersion");
builder.HasIndex(x => new { x.MockTestSectionId, x.IsArchivedVersion });
}
}
Expand Down
5 changes: 0 additions & 5 deletions RikiPath.Infrastructure/Configuration/MockTestConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public void Configure(EntityTypeBuilder<MockTest> builder)
builder.Property(x => x.SourceReference).HasMaxLength(300);
builder.Property(x => x.BlueprintPolicyJson).HasColumnType("jsonb");
builder.Property(x => x.AiProvenanceJson).HasColumnType("jsonb");
// Preserve legacy metadata without restoring it to the current domain API.
builder.Property<int>("PublishStatus");
builder.Property<DateTime?>("PublishedAt").HasColumnType("timestamp without time zone");
builder.Property<string>("RightsStatus").HasMaxLength(100);

builder.HasOne(x => x.CertificateLevel)
.WithMany(x => x.MockTests)
.HasForeignKey(x => x.CertificateLevelId)
Expand Down
Loading