using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Migrations.AppDb
{
///
public partial class RemoveDonationSettlementDeveloperDomains : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ApiApplicationScope");
migrationBuilder.DropTable(
name: "ApiCredential");
migrationBuilder.DropTable(
name: "ApiPersonalAccessToken");
migrationBuilder.DropTable(
name: "ApiPurchaseCancel");
migrationBuilder.DropTable(
name: "ApiRateLimit");
migrationBuilder.DropTable(
name: "ApiRequestLog");
migrationBuilder.DropTable(
name: "CrewDonationSummary");
migrationBuilder.DropTable(
name: "CrewInvitation");
migrationBuilder.DropTable(
name: "CrewSessionConsent");
migrationBuilder.DropTable(
name: "CrewWidgetConfig");
migrationBuilder.DropTable(
name: "DonationAlertAttempt");
migrationBuilder.DropTable(
name: "DonationAlertConfig");
migrationBuilder.DropTable(
name: "DonationGoalConfig");
migrationBuilder.DropTable(
name: "DonationMeta");
migrationBuilder.DropTable(
name: "DonationRankConfig");
migrationBuilder.DropTable(
name: "DonationRanking");
migrationBuilder.DropTable(
name: "DonorChannelStats");
migrationBuilder.DropTable(
name: "DonorTitleSelection");
migrationBuilder.DropTable(
name: "GameProductCatalog");
migrationBuilder.DropTable(
name: "NiceAuthSession");
migrationBuilder.DropTable(
name: "RankingSnapshot");
migrationBuilder.DropTable(
name: "Settlement");
migrationBuilder.DropTable(
name: "SettlementAccount");
migrationBuilder.DropTable(
name: "WithdrawalRequest");
migrationBuilder.DropTable(
name: "ApiPurchase");
migrationBuilder.DropTable(
name: "DonationAlert");
migrationBuilder.DropTable(
name: "ChannelTitle");
migrationBuilder.DropTable(
name: "Developer");
migrationBuilder.DropTable(
name: "ApiApplication");
migrationBuilder.DropTable(
name: "Donation");
migrationBuilder.DropTable(
name: "CrewMember");
migrationBuilder.DropTable(
name: "CrewSession");
migrationBuilder.DropTable(
name: "Crew");
migrationBuilder.DropColumn(
name: "ApiCommissionRate",
table: "Game");
migrationBuilder.AlterColumn(
name: "ChannelRewardAmount",
table: "Order",
type: "int",
nullable: false,
comment: "채널주 채널 보상 입금 금액 (비활성 — 과거 주문 호환)",
oldClrType: typeof(int),
oldType: "int",
oldComment: "채널주 StoreRevenue 입금 금액");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "ChannelRewardAmount",
table: "Order",
type: "int",
nullable: false,
comment: "채널주 StoreRevenue 입금 금액",
oldClrType: typeof(int),
oldType: "int",
oldComment: "채널주 채널 보상 입금 금액 (비활성 — 과거 주문 호환)");
migrationBuilder.AddColumn(
name: "ApiCommissionRate",
table: "Game",
type: "decimal(10,7)",
precision: 10,
scale: 7,
nullable: false,
defaultValue: 0m,
comment: "API 결제 보고 채널 수수료율(%) — 0~100, 0=비대상");
migrationBuilder.CreateTable(
name: "ApiApplication",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
OwnerMemberID = table.Column(type: "int", nullable: false),
ApprovedAt = table.Column(type: "datetime2", nullable: true),
CreatedAt = table.Column(type: "datetime2", nullable: false),
Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
HomepageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
LogoPath = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Status = table.Column(type: "int", nullable: false),
SuspendedAt = table.Column(type: "datetime2", nullable: true),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiApplication", x => x.ID);
table.ForeignKey(
name: "FK_ApiApplication_Member_OwnerMemberID",
column: x => x.OwnerMemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "개발자 API 앱");
migrationBuilder.CreateTable(
name: "ApiPersonalAccessToken",
columns: table => new
{
ID = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
OwnerMemberID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
ExpiresAt = table.Column(type: "datetime2", nullable: true),
LastUsedAt = table.Column(type: "datetime2", nullable: true),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
RevokedAt = table.Column(type: "datetime2", nullable: true),
ScopesCsv = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: false),
TokenHash = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
TokenHint = table.Column(type: "nvarchar(4)", maxLength: 4, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiPersonalAccessToken", x => x.ID);
table.ForeignKey(
name: "FK_ApiPersonalAccessToken_Member_OwnerMemberID",
column: x => x.OwnerMemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "Personal Access Token (PAT)");
migrationBuilder.CreateTable(
name: "ApiRequestLog",
columns: table => new
{
ID = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ApplicationID = table.Column(type: "int", nullable: true),
Endpoint = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
IpAddress = table.Column(type: "nvarchar(45)", maxLength: 45, nullable: true),
Method = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false),
PatID = table.Column(type: "bigint", nullable: true),
RequestedAt = table.Column(type: "datetime2", nullable: false),
ResponseMs = table.Column(type: "int", nullable: false),
StatusCode = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiRequestLog", x => x.ID);
},
comment: "공개 API 호출 로그");
migrationBuilder.CreateTable(
name: "ChannelTitle",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false, comment: "채널 ID"),
Color = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "칭호 색상 (hex)"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "생성 일시"),
Description = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "칭호 설명"),
IconUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "칭호 아이콘 URL"),
IsActive = table.Column(type: "bit", nullable: false, comment: "활성 여부"),
MinAmount = table.Column(type: "bigint", nullable: false, comment: "획득 조건 (누적 후원 최소 금액)"),
Name = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "칭호 이름"),
SortOrder = table.Column(type: "int", nullable: false, comment: "정렬 순서"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_ChannelTitle", x => x.ID);
table.ForeignKey(
name: "FK_ChannelTitle_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "채널별 칭호 (크리에이터 설정)");
migrationBuilder.CreateTable(
name: "Crew",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
InviteCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true),
IsActive = table.Column(type: "bit", nullable: false),
MinAmount = table.Column(type: "int", nullable: true),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Crew", x => x.ID);
table.ForeignKey(
name: "FK_Crew_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Crew_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "크루");
migrationBuilder.CreateTable(
name: "Developer",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false),
ApprovalReason = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
ApprovalStatus = table.Column(type: "int", nullable: false),
ApprovedAt = table.Column(type: "datetime2", nullable: true),
ApprovedByAdminID = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
BusinessNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false),
CeoName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
CompanyName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
ContactName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
ContactPhone = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
KycCi = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
KycDi = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
KycStatus = table.Column(type: "int", nullable: false),
KycVerifiedAt = table.Column(type: "datetime2", nullable: true),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Developer", x => x.ID);
table.ForeignKey(
name: "FK_Developer_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "개발자 포털 가입 법인 정보 (Member 1:1)");
migrationBuilder.CreateTable(
name: "DonationAlertConfig",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
Amount = table.Column(type: "int", nullable: false),
AmountFontColor = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false),
AmountFontFamily = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
AmountFontSize = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
DisplayDurationSec = table.Column(type: "float", nullable: false),
EnableImage = table.Column(type: "bit", nullable: false),
EnableSound = table.Column(type: "bit", nullable: false),
ImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column(type: "bit", nullable: false),
MatchType = table.Column(type: "int", nullable: false),
Message = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
MessageFontColor = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false),
MessageFontFamily = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
MessageFontSize = table.Column(type: "int", nullable: false),
NicknameFontColor = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false),
NicknameFontFamily = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
NicknameFontSize = table.Column(type: "int", nullable: false),
PlayDelaySec = table.Column(type: "float", nullable: false),
PopupEffect = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
SoundUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
TemplateFontColor = table.Column(type: "nvarchar(max)", nullable: false),
TemplateFontFamily = table.Column(type: "nvarchar(max)", nullable: true),
TemplateFontSize = table.Column(type: "int", nullable: false),
TextEffect = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
Title = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DonationAlertConfig", x => x.ID);
table.ForeignKey(
name: "FK_DonationAlertConfig_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DonationAlertConfig_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원 알림 위젯 설정");
migrationBuilder.CreateTable(
name: "DonationGoalConfig",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
AmountFontColor = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false),
AmountFontFamily = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
AmountFontSizePx = table.Column(type: "int", nullable: false),
BarBackgroundColor = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false),
BarColor = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false),
BarHeightPx = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
EndAt = table.Column(type: "datetime2", nullable: true),
IsActive = table.Column(type: "bit", nullable: false),
IsShowPercent = table.Column(type: "bit", nullable: false),
Period = table.Column(type: "int", nullable: false, defaultValue: 6),
StartAmount = table.Column(type: "int", nullable: false),
StartAt = table.Column(type: "datetime2", nullable: true),
Style = table.Column(type: "int", nullable: false),
TargetAmount = table.Column(type: "int", nullable: false),
Title = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
TitleFontColor = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false),
TitleFontFamily = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
TitleFontSizePx = table.Column(type: "int", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DonationGoalConfig", x => x.ID);
table.ForeignKey(
name: "FK_DonationGoalConfig_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DonationGoalConfig_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원 목표 위젯 설정");
migrationBuilder.CreateTable(
name: "DonationMeta",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
IsAccepting = table.Column(type: "bit", nullable: false),
IsAudioOnly = table.Column(type: "bit", nullable: false),
IsPaused = table.Column(type: "bit", nullable: false),
IsVideoOnly = table.Column(type: "bit", nullable: false),
MinAmount = table.Column(type: "int", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DonationMeta", x => x.ID);
table.ForeignKey(
name: "FK_DonationMeta_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DonationMeta_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원 공통 설정");
migrationBuilder.CreateTable(
name: "DonationRankConfig",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
EndAt = table.Column(type: "datetime2", nullable: true),
IsActive = table.Column(type: "bit", nullable: false),
IsShowAmount = table.Column(type: "bit", nullable: false),
IsShowDonationCount = table.Column(type: "bit", nullable: false),
IsShowGradeIcon = table.Column(type: "bit", nullable: false),
IsShowMemberIcon = table.Column(type: "bit", nullable: false),
MaxRankCount = table.Column(type: "int", nullable: false),
NameDisplayType = table.Column(type: "int", nullable: false),
NameMode = table.Column(type: "bit", nullable: true),
Period = table.Column(type: "int", nullable: false),
Rank1FontColor = table.Column(type: "nvarchar(max)", nullable: false),
Rank1FontFamily = table.Column(type: "nvarchar(max)", nullable: true),
Rank1FontSizePx = table.Column(type: "int", nullable: false),
Rank2FontColor = table.Column(type: "nvarchar(max)", nullable: false),
Rank2FontFamily = table.Column(type: "nvarchar(max)", nullable: true),
Rank2FontSizePx = table.Column(type: "int", nullable: false),
Rank3FontColor = table.Column(type: "nvarchar(max)", nullable: false),
Rank3FontFamily = table.Column(type: "nvarchar(max)", nullable: true),
Rank3FontSizePx = table.Column(type: "int", nullable: false),
StartAt = table.Column(type: "datetime2", nullable: true),
Theme = table.Column(type: "int", nullable: false),
Title = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false),
TitleFontColor = table.Column(type: "nvarchar(max)", nullable: false),
TitleFontFamily = table.Column(type: "nvarchar(max)", nullable: true),
TitleFontSizePx = table.Column(type: "int", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DonationRankConfig", x => x.ID);
table.ForeignKey(
name: "FK_DonationRankConfig_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DonationRankConfig_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원 순위 위젯 설정");
migrationBuilder.CreateTable(
name: "DonationRanking",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
SponsorMemberID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
DonationCount = table.Column(type: "int", nullable: false),
IsActive = table.Column(type: "bit", nullable: false),
PeriodEnd = table.Column(type: "datetime2", nullable: true),
PeriodStart = table.Column(type: "datetime2", nullable: false),
PeriodType = table.Column(type: "int", nullable: false),
Rank = table.Column(type: "int", nullable: false),
SponsorName = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
TotalAmount = table.Column(type: "int", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DonationRanking", x => x.ID);
table.ForeignKey(
name: "FK_DonationRanking_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DonationRanking_Member_SponsorMemberID",
column: x => x.SponsorMemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원 순위");
migrationBuilder.CreateTable(
name: "DonorChannelStats",
columns: table => new
{
DonorMemberID = table.Column(type: "int", nullable: false, comment: "후원자 회원 ID"),
ChannelID = table.Column(type: "int", nullable: false, comment: "채널 ID"),
CreatedAt = table.Column(type: "datetime2", nullable: false, comment: "생성 일시"),
CumulativeAmount = table.Column(type: "bigint", nullable: false, comment: "누적 후원 금액"),
DonationCount = table.Column(type: "int", nullable: false, comment: "후원 횟수"),
FirstDonatedAt = table.Column(type: "datetime2", nullable: true, comment: "첫 후원 일시"),
LastDonatedAt = table.Column(type: "datetime2", nullable: true, comment: "마지막 후원 일시"),
UpdatedAt = table.Column(type: "datetime2", nullable: true, comment: "수정 일시")
},
constraints: table =>
{
table.PrimaryKey("PK_DonorChannelStats", x => new { x.DonorMemberID, x.ChannelID });
table.ForeignKey(
name: "FK_DonorChannelStats_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID");
table.ForeignKey(
name: "FK_DonorChannelStats_Member_DonorMemberID",
column: x => x.DonorMemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "후원자×채널 누적 후원 (칭호 획득 판정용)");
migrationBuilder.CreateTable(
name: "GameProductCatalog",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
GameID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
IsActive = table.Column(type: "bit", nullable: false),
Price = table.Column(type: "int", nullable: false),
ProductID = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GameProductCatalog", x => x.ID);
table.ForeignKey(
name: "FK_GameProductCatalog_Game_GameID",
column: x => x.GameID,
principalTable: "Game",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "게임별 인앱 상품 SKU 정가 카탈로그 (API 결제 보고가 검증용)");
migrationBuilder.CreateTable(
name: "RankingSnapshot",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
MemberID = table.Column(type: "int", nullable: false, comment: "회원 ID"),
BroadcastSec = table.Column(type: "bigint", nullable: false, comment: "방송 시간 (초)"),
Category = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: true, comment: "카테고리 (전체/게임/버츄얼/토크/음악/먹방)"),
DonorCount = table.Column(type: "int", nullable: false, comment: "후원자 수"),
LikeCount = table.Column(type: "bigint", nullable: false, comment: "좋아요"),
MoneyAmount = table.Column(type: "bigint", nullable: false, comment: "수령/후원 금액"),
Period = table.Column(type: "int", nullable: false, comment: "기간 (1=오늘, 2=어제, 3=이번주, 4=이번달, 5=지난달, 6=전체)"),
PeriodEnd = table.Column(type: "datetime2", nullable: false, comment: "기간 종료"),
PeriodStart = table.Column(type: "datetime2", nullable: false, comment: "기간 시작"),
PreviousRank = table.Column(type: "int", nullable: true, comment: "전일 순위"),
Rank = table.Column(type: "int", nullable: false, comment: "순위"),
Score = table.Column(type: "bigint", nullable: false, comment: "종합 점수"),
SnapshotAt = table.Column(type: "datetime2", nullable: false, comment: "스냅샷 일시"),
Type = table.Column(type: "int", nullable: false, comment: "랭킹 종류 (1=종합, 2=크리에이터, 3=후원자)"),
ViewCount = table.Column(type: "bigint", nullable: false, comment: "조회수")
},
constraints: table =>
{
table.PrimaryKey("PK_RankingSnapshot", x => x.ID);
table.ForeignKey(
name: "FK_RankingSnapshot_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "랭킹 스냅샷 (일 1회 집계)");
migrationBuilder.CreateTable(
name: "Settlement",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
AdminMemo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
ApprovedAt = table.Column(type: "datetime2", nullable: true),
FeeAmount = table.Column(type: "int", nullable: false),
GrossAmount = table.Column(type: "int", nullable: false),
NetAmount = table.Column(type: "int", nullable: false),
PaidAt = table.Column(type: "datetime2", nullable: true),
PeriodEnd = table.Column(type: "datetime2", nullable: false),
PeriodStart = table.Column(type: "datetime2", nullable: false),
RequestedAt = table.Column(type: "datetime2", nullable: false),
Status = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Settlement", x => x.ID);
table.ForeignKey(
name: "FK_Settlement_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID");
table.ForeignKey(
name: "FK_Settlement_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "정산");
migrationBuilder.CreateTable(
name: "SettlementAccount",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
AccountHolder = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
AccountNumber = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false),
BankCode = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false),
BankName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
IsVerified = table.Column(type: "bit", nullable: false),
UpdatedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SettlementAccount", x => x.ID);
table.ForeignKey(
name: "FK_SettlementAccount_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID");
table.ForeignKey(
name: "FK_SettlementAccount_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "정산 계좌");
migrationBuilder.CreateTable(
name: "WithdrawalRequest",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ChannelID = table.Column(type: "int", nullable: false),
MemberID = table.Column(type: "int", nullable: false),
AccountHolder = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
AccountNumber = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false),
AdminMemo = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
BankCode = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false),
BankName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
DonationAmount = table.Column(type: "int", nullable: false, defaultValue: 0, comment: "후원 수익(Donation) 잔액에서 차감되는 금액"),
IncomeTax = table.Column(type: "int", nullable: false),
LocalTax = table.Column(type: "int", nullable: false),
NetAmount = table.Column(type: "int", nullable: false),
ProcessedAt = table.Column(type: "datetime2", nullable: true),
RejectedReason = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
RequestedAmount = table.Column(type: "int", nullable: false),
RequestedAt = table.Column(type: "datetime2", nullable: false),
Status = table.Column(type: "int", nullable: false),
StoreRevenueAmount = table.Column(type: "int", nullable: false, defaultValue: 0, comment: "상품 판매 수익(StoreRevenue) 잔액에서 차감되는 금액"),
WithholdingTax = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WithdrawalRequest", x => x.ID);
table.ForeignKey(
name: "FK_WithdrawalRequest_Channel_ChannelID",
column: x => x.ChannelID,
principalTable: "Channel",
principalColumn: "ID");
table.ForeignKey(
name: "FK_WithdrawalRequest_Member_MemberID",
column: x => x.MemberID,
principalTable: "Member",
principalColumn: "ID");
},
comment: "출금 요청");
migrationBuilder.CreateTable(
name: "ApiApplicationScope",
columns: table => new
{
ID = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ApplicationID = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false),
Scope = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiApplicationScope", x => x.ID);
table.ForeignKey(
name: "FK_ApiApplicationScope_ApiApplication_ApplicationID",
column: x => x.ApplicationID,
principalTable: "ApiApplication",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
},
comment: "앱이 요청한 scope 목록");
migrationBuilder.CreateTable(
name: "ApiCredential",
columns: table => new
{
ID = table.Column