using Domain.Entities.Developers; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Infrastructure.Persistence.Configurations.Developers; public class ApiApplicationConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasOne(x => x.Owner).WithMany().HasForeignKey(x => x.OwnerMemberID).OnDelete(DeleteBehavior.Cascade); builder.HasIndex(x => x.OwnerMemberID); builder.HasIndex(x => x.Status); builder.ToTable(nameof(ApiApplication), x => x.HasComment("개발자 API 앱")); builder.HasKey(x => x.ID); builder.Property(x => x.Name).HasMaxLength(100).IsRequired(); builder.Property(x => x.Description).HasMaxLength(500); builder.Property(x => x.HomepageUrl).HasMaxLength(500); builder.Property(x => x.LogoPath).HasMaxLength(500); builder.Property(x => x.Status).HasConversion().IsRequired(); builder.Property(x => x.CreatedAt).IsRequired(); } }