feat: establish formal relationship between KnowledgeUnit and Ebook (#35)
- Refactored KnowledgeUnit to use Guid EbookId and added navigation property - Updated AppDbContext with fluent configuration and cascade delete - Propagated ebookId through IKnowledgeService and API endpoints - Generated EF migration for schema changes
This commit is contained in:
@@ -65,8 +65,13 @@ public class AppDbContext : IdentityDbContext<NexusUser>
|
||||
{
|
||||
entity.HasKey(e => e.Id);
|
||||
entity.HasIndex(e => e.TenantId);
|
||||
entity.HasIndex(e => e.SourceId);
|
||||
entity.HasIndex(e => e.EbookId);
|
||||
entity.Property(e => e.Vector).HasColumnType("vector(768)");
|
||||
|
||||
entity.HasOne(e => e.Ebook)
|
||||
.WithMany()
|
||||
.HasForeignKey(e => e.EbookId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<KnowledgeUnitLink>(entity =>
|
||||
|
||||
Reference in New Issue
Block a user