using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using PnvPanel.Domain.Inbounds; namespace PnvPanel.Infrastructure.Persistence.Configurations; public class InboundConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("Inbounds"); builder.HasKey(x => x.Id); builder.Property(x => x.RemoteInboundId).IsRequired().HasMaxLength(64); builder.Property(x => x.Protocol).HasConversion().HasMaxLength(32); builder.Property(x => x.Remark).IsRequired().HasMaxLength(200); builder.Property(x => x.DisplayName).HasMaxLength(100); builder.Property(x => x.CountryCode).HasMaxLength(2); builder.Property(x => x.AllowedRoleIds).HasColumnType("uuid[]"); builder.HasIndex(x => new { x.NodeId, x.RemoteInboundId }).IsUnique(); } }