using Microsoft.EntityFrameworkCore; namespace GhostImageManager.Data; public class AppDbContext : DbContext { public AppDbContext(DbContextOptions options) : base(options) { } public DbSet ManagedImages => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); entity.HasIndex(e => e.GhostImageUrl); entity.HasIndex(e => e.GhostInstanceId); entity.HasIndex(e => e.FileName); entity.HasIndex(e => e.AuthorId); entity.HasIndex(e => e.Theme); entity.HasIndex(e => e.CaptureDate); entity.Property(e => e.GhostImageUrl).HasMaxLength(2000); entity.Property(e => e.RelativePath).HasMaxLength(1000); entity.Property(e => e.FileName).HasMaxLength(500); entity.Property(e => e.GhostInstanceId).HasMaxLength(100); entity.Property(e => e.AuthorId).HasMaxLength(100); entity.Property(e => e.AuthorName).HasMaxLength(200); entity.Property(e => e.CameraMake).HasMaxLength(200); entity.Property(e => e.CameraModel).HasMaxLength(200); entity.Property(e => e.Lens).HasMaxLength(200); entity.Property(e => e.Aperture).HasMaxLength(50); entity.Property(e => e.ShutterSpeed).HasMaxLength(50); entity.Property(e => e.Iso).HasMaxLength(50); entity.Property(e => e.FocalLength).HasMaxLength(50); entity.Property(e => e.Theme).HasMaxLength(500); entity.Property(e => e.Category).HasMaxLength(200); entity.Property(e => e.CategorySecondary).HasMaxLength(200); entity.Property(e => e.Keywords).HasMaxLength(500); }); } }