68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
namespace BrokerCore.Repository.SqlConfig;
|
|
|
|
using DbEntity;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
public class SapphireExchangeOrderConfig : IEntityTypeConfiguration<SapphireExchangeOrder>
|
|
{
|
|
public void Configure(EntityTypeBuilder<SapphireExchangeOrder> builder)
|
|
{
|
|
builder.ToTable("sapphire_exchange_order");
|
|
|
|
builder.HasKey(x => x.OrderId);
|
|
builder.HasIndex(x => x.CreatedAt);
|
|
builder.HasIndex(x => x.OrderStatus);
|
|
builder.HasIndex(x => x.AccountId);
|
|
builder.HasIndex(x => x.UserGuid);
|
|
builder.HasIndex(x => x.PlanetId);
|
|
|
|
builder.Property(x => x.OrderId)
|
|
.HasColumnName("order_id")
|
|
.HasColumnType("varchar(60)")
|
|
.HasComment("사파이어 교환 주문 아이디 guid")
|
|
.IsRequired();
|
|
builder.Property(x => x.OrderStatus)
|
|
.HasColumnName("order_status")
|
|
.HasComment("사파이어 교환 주문 상태")
|
|
.HasColumnType("tinyint")
|
|
.IsRequired();
|
|
builder.Property(x => x.AccountId)
|
|
.HasColumnName("account_id")
|
|
.HasComment("sso 계정 아이디")
|
|
.HasColumnType("bigint unsigned")
|
|
.IsRequired();
|
|
builder.Property(x => x.UserGuid)
|
|
.HasColumnName("user_guid")
|
|
.HasComment("유저 아이디")
|
|
.HasColumnType("varchar(50)")
|
|
.IsRequired();
|
|
builder.Property(x => x.PlanetId)
|
|
.HasColumnName("planet_id")
|
|
.HasComment("플래닛 아이디")
|
|
.HasColumnType("varchar(50)")
|
|
.IsRequired();
|
|
builder.Property(x => x.SapphireReducedDelta)
|
|
.HasColumnName("sapphire_reduced_amount")
|
|
.HasComment("사파이어 차감 수량")
|
|
.HasColumnType("decimal(20, 0)")
|
|
.IsRequired();
|
|
builder.Property(x => x.PlanetMoneyIncDelta)
|
|
.HasColumnName("planet_money_amount")
|
|
.HasComment("플래닛에서 발급한 재화 수량")
|
|
.HasColumnType("decimal(20, 0)")
|
|
.IsRequired();
|
|
builder.Property(x => x.CreatedAt)
|
|
.HasColumnName("created_at")
|
|
.HasComment("사파이어 교환 주문 시작 시간")
|
|
.HasColumnType("timestamp")
|
|
.IsRequired();
|
|
builder.Property(x => x.CompletedAt)
|
|
.HasColumnName("completed_at")
|
|
.HasComment("사파이어 교환 주문 완료 시간")
|
|
.HasColumnType("timestamp")
|
|
.IsRequired(false);
|
|
}
|
|
}
|