using Microsoft.EntityFrameworkCore; using CodePlay.Core.Models; namespace CodePlay.Persistence; public class AppDbContext : DbContext { public AppDbContext(DbContextOptions options) : base(options) { } public DbSet ConversionReports { get; set; } public DbSet Projects { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); entity.Property(e => e.Id).HasMaxLength(50); entity.Property(e => e.ProjectId).HasMaxLength(50); entity.HasIndex(e => e.ProjectId); entity.HasIndex(e => e.CreatedAt); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); entity.Property(e => e.Id).HasMaxLength(50); entity.Property(e => e.Name).HasMaxLength(200); }); } }