using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace BrokerApiCore; public class PlanetItemExchangeOrderAmountUserLimitConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { // 테이블 이름 builder.ToTable("planet_exchange_order_amount_user_limits"); // 인덱스 builder.HasIndex(o => o.ExchangeMetaId); builder.HasIndex(o => o.ExchangeDate); builder.HasIndex(o => o.SeasonId); builder.HasIndex(o => o.UserGuid); // 복합 기본 키 (Primary Key) - ExchangeMetaId에 PlanetId 속성이 있으므로 생략함 builder.HasKey(o => new { o.ExchangeMetaId, o.ExchangeDate, o.SeasonId, o.UserGuid }); // 교환 메타 아이디 builder.Property(o => o.ExchangeMetaId) .HasColumnName("exchange_meta_id") .HasMaxLength(50) .IsRequired() .HasComment("교환 메타 아이디"); // 교환 일자 builder.Property(o => o.ExchangeDate) .HasColumnName("exchange_date") .IsRequired() .HasComment("교환 일자"); // 유저 아이디 builder.Property(o => o.UserGuid) .HasColumnName("user_guid") .HasMaxLength(50) .IsRequired() .HasComment("유저 아이디 (GUID)"); // 교환 메타 수량 builder.Property(o => o.DailyAmount) .HasColumnName("daily_amount") .HasColumnType("INT") .IsRequired() .HasComment("사용자별 일일 교환 메타 수량"); builder.Property(o => o.SeasonId) .HasColumnName("season_id") .HasMaxLength(50) .IsRequired() .HasComment("시즌 아이디"); builder.Property(o => o.CreatedAt) .HasColumnName("created_at") .HasColumnType("TIMESTAMP") .IsRequired() .HasComment("생성 일자"); builder.Property(o => o.UpdatedAt) .HasColumnName("updated_at") .HasColumnType("TIMESTAMP") .IsRequired() .HasComment("업데이트 일자"); } }