SPMS_API/SPMS.Infrastructure/Migrations/20260209023245_InitialCreate.cs
SEAN cfce5ca8b8 feat: Domain Entity 정의 및 DB 스키마 구축 (#8)
- 12개 Domain Entity 클래스 정의 (DB_Schema.md 기반)
- 12개 EF Core Fluent API Configuration 구현
- AppDbContext에 DbSet 12개 등록 및 Configuration 자동 적용
- Soft Delete 글로벌 쿼리 필터 적용 (Service, Admin, Message)
- DesignTimeDbContextFactory 추가 (EF Core CLI 지원)
- InitialCreate 마이그레이션 생성 및 spms_dev DB 적용 완료
- .gitignore에 Documents/, CLAUDE.md, TASKS.md, .mcp.json 추가

Closes #8
2026-02-09 11:46:33 +09:00

610 lines
31 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SPMS.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Admin",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AdminCode = table.Column<string>(type: "varchar(8)", maxLength: 8, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Password = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Phone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Role = table.Column<sbyte>(type: "tinyint", nullable: false),
EmailVerified = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
EmailVerifiedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastLoginAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeletedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Admin", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Service",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceCode = table.Column<string>(type: "varchar(8)", maxLength: 8, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ServiceName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApiKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ApiKeyCreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ApnsBundleId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApnsKeyId = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApnsTeamId = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApnsPrivateKey = table.Column<string>(type: "text", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FcmCredentials = table.Column<string>(type: "text", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
WebhookUrl = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Tags = table.Column<string>(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SubTier = table.Column<sbyte>(type: "tinyint", nullable: false),
SubStartedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Status = table.Column<sbyte>(type: "tinyint", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedBy = table.Column<long>(type: "bigint", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeletedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Service", x => x.Id);
table.ForeignKey(
name: "FK_Service_Admin_CreatedBy",
column: x => x.CreatedBy,
principalTable: "Admin",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DailyStat",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
StatDate = table.Column<DateOnly>(type: "date", nullable: false),
SentCnt = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
SuccessCnt = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
FailCnt = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
OpenCnt = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DailyStat", x => x.Id);
table.ForeignKey(
name: "FK_DailyStat_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Device",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
DeviceToken = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Platform = table.Column<sbyte>(type: "tinyint", nullable: false),
AppVersion = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OsVersion = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceModel = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Tags = table.Column<string>(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PushAgreed = table.Column<bool>(type: "tinyint(1)", nullable: false),
MarketingAgreed = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: true),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
AgreeUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
MktAgreeUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Device", x => x.Id);
table.ForeignKey(
name: "FK_Device_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "File",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
FileName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FilePath = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FileSize = table.Column<long>(type: "bigint", nullable: false),
FileType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
MimeType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedBy = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_File", x => x.Id);
table.ForeignKey(
name: "FK_File_Admin_CreatedBy",
column: x => x.CreatedBy,
principalTable: "Admin",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_File_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Message",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
MessageCode = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Body = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ImageUrl = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LinkUrl = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CustomData = table.Column<string>(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedBy = table.Column<long>(type: "bigint", nullable: false),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeletedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Message", x => x.Id);
table.ForeignKey(
name: "FK_Message_Admin_CreatedBy",
column: x => x.CreatedBy,
principalTable: "Admin",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Message_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Payment",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
AdminId = table.Column<long>(type: "bigint", nullable: false),
Amount = table.Column<int>(type: "int", nullable: false),
Currency = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PaymentMethod = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PaymentKey = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<sbyte>(type: "tinyint", nullable: false),
TierBefore = table.Column<sbyte>(type: "tinyint", nullable: true),
TierAfter = table.Column<sbyte>(type: "tinyint", nullable: false),
PaidAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Payment", x => x.Id);
table.ForeignKey(
name: "FK_Payment_Admin_AdminId",
column: x => x.AdminId,
principalTable: "Admin",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Payment_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServiceIp",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
IpAddress = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceIp", x => x.Id);
table.ForeignKey(
name: "FK_ServiceIp_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "SystemLog",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: true),
AdminId = table.Column<long>(type: "bigint", nullable: true),
Action = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TargetType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TargetId = table.Column<long>(type: "bigint", nullable: true),
Details = table.Column<string>(type: "json", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IpAddress = table.Column<string>(type: "varchar(45)", maxLength: 45, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SystemLog", x => x.Id);
table.ForeignKey(
name: "FK_SystemLog_Admin_AdminId",
column: x => x.AdminId,
principalTable: "Admin",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_SystemLog_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "WebhookLog",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
WebhookUrl = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EventType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Payload = table.Column<string>(type: "json", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<sbyte>(type: "tinyint", nullable: false),
ResponseCode = table.Column<int>(type: "int", nullable: true),
ResponseBody = table.Column<string>(type: "text", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SentAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WebhookLog", x => x.Id);
table.ForeignKey(
name: "FK_WebhookLog_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PushOpenLog",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
MessageId = table.Column<long>(type: "bigint", nullable: false),
DeviceId = table.Column<long>(type: "bigint", nullable: false),
OpenedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PushOpenLog", x => x.Id);
table.ForeignKey(
name: "FK_PushOpenLog_Device_DeviceId",
column: x => x.DeviceId,
principalTable: "Device",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_PushOpenLog_Message_MessageId",
column: x => x.MessageId,
principalTable: "Message",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_PushOpenLog_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PushSendLog",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ServiceId = table.Column<long>(type: "bigint", nullable: false),
MessageId = table.Column<long>(type: "bigint", nullable: false),
DeviceId = table.Column<long>(type: "bigint", nullable: false),
Status = table.Column<sbyte>(type: "tinyint", nullable: false),
FailReason = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SentAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PushSendLog", x => x.Id);
table.ForeignKey(
name: "FK_PushSendLog_Device_DeviceId",
column: x => x.DeviceId,
principalTable: "Device",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_PushSendLog_Message_MessageId",
column: x => x.MessageId,
principalTable: "Message",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_PushSendLog_Service_ServiceId",
column: x => x.ServiceId,
principalTable: "Service",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Admin_AdminCode",
table: "Admin",
column: "AdminCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Admin_Email",
table: "Admin",
column: "Email",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_DailyStat_ServiceId_StatDate",
table: "DailyStat",
columns: new[] { "ServiceId", "StatDate" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Device_ServiceId_DeviceToken",
table: "Device",
columns: new[] { "ServiceId", "DeviceToken" });
migrationBuilder.CreateIndex(
name: "IX_File_CreatedBy",
table: "File",
column: "CreatedBy");
migrationBuilder.CreateIndex(
name: "IX_File_ServiceId",
table: "File",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_Message_CreatedBy",
table: "Message",
column: "CreatedBy");
migrationBuilder.CreateIndex(
name: "IX_Message_MessageCode",
table: "Message",
column: "MessageCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Message_ServiceId",
table: "Message",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_Payment_AdminId",
table: "Payment",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_Payment_ServiceId",
table: "Payment",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_PushOpenLog_DeviceId",
table: "PushOpenLog",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_PushOpenLog_MessageId",
table: "PushOpenLog",
column: "MessageId");
migrationBuilder.CreateIndex(
name: "IX_PushOpenLog_ServiceId_OpenedAt",
table: "PushOpenLog",
columns: new[] { "ServiceId", "OpenedAt" });
migrationBuilder.CreateIndex(
name: "IX_PushSendLog_DeviceId",
table: "PushSendLog",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_PushSendLog_MessageId",
table: "PushSendLog",
column: "MessageId");
migrationBuilder.CreateIndex(
name: "IX_PushSendLog_ServiceId_SentAt",
table: "PushSendLog",
columns: new[] { "ServiceId", "SentAt" });
migrationBuilder.CreateIndex(
name: "IX_Service_CreatedBy",
table: "Service",
column: "CreatedBy");
migrationBuilder.CreateIndex(
name: "IX_Service_ServiceCode",
table: "Service",
column: "ServiceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ServiceIp_ServiceId",
table: "ServiceIp",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_SystemLog_AdminId",
table: "SystemLog",
column: "AdminId");
migrationBuilder.CreateIndex(
name: "IX_SystemLog_CreatedAt",
table: "SystemLog",
column: "CreatedAt");
migrationBuilder.CreateIndex(
name: "IX_SystemLog_ServiceId",
table: "SystemLog",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_WebhookLog_ServiceId_SentAt",
table: "WebhookLog",
columns: new[] { "ServiceId", "SentAt" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DailyStat");
migrationBuilder.DropTable(
name: "File");
migrationBuilder.DropTable(
name: "Payment");
migrationBuilder.DropTable(
name: "PushOpenLog");
migrationBuilder.DropTable(
name: "PushSendLog");
migrationBuilder.DropTable(
name: "ServiceIp");
migrationBuilder.DropTable(
name: "SystemLog");
migrationBuilder.DropTable(
name: "WebhookLog");
migrationBuilder.DropTable(
name: "Device");
migrationBuilder.DropTable(
name: "Message");
migrationBuilder.DropTable(
name: "Service");
migrationBuilder.DropTable(
name: "Admin");
}
}
}