Files
caliverse_server/BrokerApiCore/Repository/SqlConfig/PlanetItemExchangeOrderAmountTotalLimitConfig.cs
2025-05-01 07:23:28 +09:00

63 lines
1.7 KiB
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace BrokerApiCore;
public class PlanetItemExchangeOrderAmountTotalLimitConfig : IEntityTypeConfiguration<PlanetItemExchangeOrderAmountTotalLimit>
{
public void Configure(EntityTypeBuilder<PlanetItemExchangeOrderAmountTotalLimit> builder)
{
// 테이블 이름
builder.ToTable("planet_exchange_order_amount_total_limits");
// 인덱스
builder.HasIndex(o => o.ExchangeDate);
builder.HasIndex(o => o.ExchangeMetaId);
builder.HasIndex(o => o.SeasonId);
// 복합 기본 키 (Primary Key) - ExchangeMetaId에 PlanetId 속성이 있으므로 생략함
builder.HasKey(o => new { o.ExchangeMetaId, o.ExchangeDate, o.SeasonId});
// 교환 메타 아이디
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.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("업데이트 일자");
}
}