using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using RecNet.Domain.Profiles; namespace RecNet.Infrastructure.Persistence.Configurations; public class ProfileConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(x => x.ProfileId); builder.Property(x => x.Name) .HasMaxLength(Profile.MaxNameLength) .IsRequired(); builder.Property(x => x.Platform) .HasConversion() .HasMaxLength(50) .IsRequired(); builder.Property(x => x.PlatformId) .HasMaxLength(50) .IsRequired(); builder.Property(x => x.DeviceIds) .HasColumnType("jsonb"); builder.Property(x => x.CreatedAt) .IsRequired(); builder.HasIndex(x => new { x.Platform, x.PlatformId }) .IsUnique(); } }