초기커밋
This commit is contained in:
56
BrokerApiCore/Repository/SqlConfig/PlanetInfoConfig.cs
Normal file
56
BrokerApiCore/Repository/SqlConfig/PlanetInfoConfig.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
namespace BrokerCore.Repository.SqlConfig;
|
||||
|
||||
using DbEntity;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
public class PlanetInfoConfig : IEntityTypeConfiguration<PlanetInfo>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<PlanetInfo> builder)
|
||||
{
|
||||
builder.ToTable("planet_info");
|
||||
|
||||
builder.HasKey(x => x.PlanetId);
|
||||
builder.HasIndex(x => x.PlanetName);
|
||||
builder.HasIndex(x => x.CompanyName);
|
||||
builder.HasIndex(x => x.SecretKey);
|
||||
|
||||
builder.Property(x => x.PlanetId)
|
||||
.IsRequired()
|
||||
.HasColumnName("planet_id")
|
||||
.HasColumnType("varchar(50)");
|
||||
builder.Property(x => x.PlanetName)
|
||||
.IsRequired()
|
||||
.HasColumnName("planet_name")
|
||||
.HasColumnType("varchar(32)");
|
||||
builder.Property(x => x.CompanyName)
|
||||
.IsRequired()
|
||||
.HasColumnName("company_name")
|
||||
.HasColumnType("varchar(32)");
|
||||
builder.Property(x => x.SecretKey)
|
||||
.IsRequired()
|
||||
.HasColumnName("secret_key")
|
||||
.HasColumnType("varchar(50)");
|
||||
builder.Property(x => x.ServerType)
|
||||
.IsRequired()
|
||||
.HasColumnName("server_type")
|
||||
.HasColumnType("varchar(50)");
|
||||
builder.Property(x => x.Description)
|
||||
.IsRequired()
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("varchar(255)");
|
||||
builder.Property(x => x.CreatedAt)
|
||||
.HasColumnName("created_at")
|
||||
.HasComment("생성 시간")
|
||||
.HasColumnType("timestamp")
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP"); // MySQL 기본값
|
||||
builder.Property(x => x.UpdatedAt)
|
||||
.HasColumnName("updated_at")
|
||||
.HasComment("수정 시간")
|
||||
.HasColumnType("timestamp")
|
||||
.IsRequired()
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"); // MySQL 기본값
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user