using Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Data.Configurations { public class NoteHistoryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(h => h.Id); // Indexes builder.HasIndex(h => h.NoteId); builder.HasIndex(h => h.ModifiedAt); builder.HasIndex(h => new { h.NoteId, h.ModifiedAt }); // Constraints builder.Property(h => h.Title) .IsRequired() .HasMaxLength(200); builder.Property(h => h.Content) .HasColumnType("TEXT"); builder.Property(h => h.ModifiedBy) .HasMaxLength(255); builder.Property(h => h.ChangeType) .IsRequired() .HasMaxLength(50); // Relationship is configured in NoteConfiguration } } }