SPMS_API/SPMS.Infrastructure/Migrations/20260209042244_ApplyDomainEnums.Designer.cs
SEAN 8b6fd84b98 feat: Domain Enum 및 에러 코드 상수 정의 (#10)
- 12개 Enum 추가 (Platform, ServiceStatus, SubTier, AdminRole, DeviceStatus, MessageStatus, PushResult, PaymentStatus, TargetType, LinkType, WebhookEvent, WebhookStatus)
- ErrorCodes 상수 클래스 추가 (Error_Codes.md 기반 3자리 코드)
- Entity byte 필드를 Enum 타입으로 변경 (Service, Admin, Device, PushSendLog, WebhookLog, Payment)
- WebhookLog.EventType 컬럼 타입 변경 (varchar→tinyint) 마이그레이션 적용
2026-02-09 13:31:50 +09:00

838 lines
29 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SPMS.Infrastructure;
#nullable disable
namespace SPMS.Infrastructure.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260209042244_ApplyDomainEnums")]
partial class ApplyDomainEnums
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("SPMS.Domain.Entities.Admin", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<string>("AdminCode")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("varchar(8)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<bool>("EmailVerified")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("EmailVerifiedAt")
.HasColumnType("datetime(6)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<DateTime?>("LastLoginAt")
.HasColumnType("datetime(6)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<sbyte>("Role")
.HasColumnType("tinyint");
b.HasKey("Id");
b.HasIndex("AdminCode")
.IsUnique();
b.HasIndex("Email")
.IsUnique();
b.ToTable("Admin", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.DailyStat", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<int>("FailCnt")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<int>("OpenCnt")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<int>("SentCnt")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<DateOnly>("StatDate")
.HasColumnType("date");
b.Property<int>("SuccessCnt")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(0);
b.HasKey("Id");
b.HasIndex("ServiceId", "StatDate")
.IsUnique();
b.ToTable("DailyStat", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.Device", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<DateTime?>("AgreeUpdatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("AppVersion")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("DeviceModel")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceToken")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property<bool>("IsActive")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<bool>("MarketingAgreed")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("MktAgreeUpdatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("OsVersion")
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<sbyte>("Platform")
.HasColumnType("tinyint");
b.Property<bool>("PushAgreed")
.HasColumnType("tinyint(1)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<string>("Tags")
.HasColumnType("json");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("ServiceId", "DeviceToken");
b.ToTable("Device", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.FileEntity", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<long>("CreatedBy")
.HasColumnType("bigint");
b.Property<string>("FileName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("FilePath")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<long>("FileSize")
.HasColumnType("bigint");
b.Property<string>("FileType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("MimeType")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ServiceId");
b.ToTable("File", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.Message", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<string>("Body")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<long>("CreatedBy")
.HasColumnType("bigint");
b.Property<string>("CustomData")
.HasColumnType("json");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("datetime(6)");
b.Property<string>("ImageUrl")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<string>("LinkUrl")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("MessageCode")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("MessageCode")
.IsUnique();
b.HasIndex("ServiceId");
b.ToTable("Message", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.Payment", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<long>("AdminId")
.HasColumnType("bigint");
b.Property<int>("Amount")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Currency")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<DateTime>("PaidAt")
.HasColumnType("datetime(6)");
b.Property<string>("PaymentKey")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PaymentMethod")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<sbyte>("Status")
.HasColumnType("tinyint");
b.Property<sbyte>("TierAfter")
.HasColumnType("tinyint");
b.Property<sbyte?>("TierBefore")
.HasColumnType("tinyint");
b.HasKey("Id");
b.HasIndex("AdminId");
b.HasIndex("ServiceId");
b.ToTable("Payment", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.PushOpenLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<long>("DeviceId")
.HasColumnType("bigint");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<DateTime>("OpenedAt")
.HasColumnType("datetime(6)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("DeviceId");
b.HasIndex("MessageId");
b.HasIndex("ServiceId", "OpenedAt");
b.ToTable("PushOpenLog", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.PushSendLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<long>("DeviceId")
.HasColumnType("bigint");
b.Property<string>("FailReason")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<long>("MessageId")
.HasColumnType("bigint");
b.Property<DateTime>("SentAt")
.HasColumnType("datetime(6)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<sbyte>("Status")
.HasColumnType("tinyint");
b.HasKey("Id");
b.HasIndex("DeviceId");
b.HasIndex("MessageId");
b.HasIndex("ServiceId", "SentAt");
b.ToTable("PushSendLog", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.Service", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<string>("ApiKey")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<DateTime>("ApiKeyCreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("ApnsBundleId")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ApnsKeyId")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<string>("ApnsPrivateKey")
.HasColumnType("text");
b.Property<string>("ApnsTeamId")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<long>("CreatedBy")
.HasColumnType("bigint");
b.Property<DateTime?>("DeletedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("FcmCredentials")
.HasColumnType("text");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false);
b.Property<string>("ServiceCode")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("varchar(8)");
b.Property<string>("ServiceName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<sbyte>("Status")
.HasColumnType("tinyint");
b.Property<DateTime?>("SubStartedAt")
.HasColumnType("datetime(6)");
b.Property<sbyte>("SubTier")
.HasColumnType("tinyint");
b.Property<string>("Tags")
.HasColumnType("json");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("WebhookUrl")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ServiceCode")
.IsUnique();
b.ToTable("Service", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.ServiceIp", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<string>("IpAddress")
.IsRequired()
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ServiceId");
b.ToTable("ServiceIp", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.SystemLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<long?>("AdminId")
.HasColumnType("bigint");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Details")
.HasColumnType("json");
b.Property<string>("IpAddress")
.HasMaxLength(45)
.HasColumnType("varchar(45)");
b.Property<long?>("ServiceId")
.HasColumnType("bigint");
b.Property<long?>("TargetId")
.HasColumnType("bigint");
b.Property<string>("TargetType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("Id");
b.HasIndex("AdminId");
b.HasIndex("CreatedAt");
b.HasIndex("ServiceId");
b.ToTable("SystemLog", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.WebhookLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
b.Property<sbyte>("EventType")
.HasColumnType("tinyint");
b.Property<string>("Payload")
.IsRequired()
.HasColumnType("json");
b.Property<string>("ResponseBody")
.HasColumnType("text");
b.Property<int?>("ResponseCode")
.HasColumnType("int");
b.Property<DateTime>("SentAt")
.HasColumnType("datetime(6)");
b.Property<long>("ServiceId")
.HasColumnType("bigint");
b.Property<sbyte>("Status")
.HasColumnType("tinyint");
b.Property<string>("WebhookUrl")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.HasKey("Id");
b.HasIndex("ServiceId", "SentAt");
b.ToTable("WebhookLog", (string)null);
});
modelBuilder.Entity("SPMS.Domain.Entities.DailyStat", b =>
{
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.Device", b =>
{
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany("Devices")
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.FileEntity", b =>
{
b.HasOne("SPMS.Domain.Entities.Admin", "CreatedByAdmin")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("CreatedByAdmin");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.Message", b =>
{
b.HasOne("SPMS.Domain.Entities.Admin", "CreatedByAdmin")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany("Messages")
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("CreatedByAdmin");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.Payment", b =>
{
b.HasOne("SPMS.Domain.Entities.Admin", "Admin")
.WithMany()
.HasForeignKey("AdminId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Admin");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.PushOpenLog", b =>
{
b.HasOne("SPMS.Domain.Entities.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Message", "Message")
.WithMany()
.HasForeignKey("MessageId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Device");
b.Navigation("Message");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.PushSendLog", b =>
{
b.HasOne("SPMS.Domain.Entities.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Message", "Message")
.WithMany()
.HasForeignKey("MessageId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Device");
b.Navigation("Message");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.Service", b =>
{
b.HasOne("SPMS.Domain.Entities.Admin", "CreatedByAdmin")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("CreatedByAdmin");
});
modelBuilder.Entity("SPMS.Domain.Entities.ServiceIp", b =>
{
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany("ServiceIps")
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.SystemLog", b =>
{
b.HasOne("SPMS.Domain.Entities.Admin", "Admin")
.WithMany()
.HasForeignKey("AdminId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Admin");
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.WebhookLog", b =>
{
b.HasOne("SPMS.Domain.Entities.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Service");
});
modelBuilder.Entity("SPMS.Domain.Entities.Service", b =>
{
b.Navigation("Devices");
b.Navigation("Messages");
b.Navigation("ServiceIps");
});
#pragma warning restore 612, 618
}
}
}