using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Nuuru.Server.Data.EntityConfigurations { public class CommentConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.Property(c => c.ContentRaw) .HasColumnType("text"); builder.Property(c => c.ContentHtml) .HasColumnType("text"); // Index for fetching comments by post (ordered by date) builder.HasIndex(c => c.PostId); builder.HasIndex(c => new { c.PostId, c.CreatedAt }); // Index for user stats count query builder.HasIndex(c => c.UserId); // Indexes for time-filtered leaderboard queries builder.HasIndex(c => c.CreatedAt); builder.HasIndex(c => new { c.UserId, c.CreatedAt }); } } }