using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Infrastructure.Migrations.AppDb; /// public partial class AddChatExpConfigAndMemberExpLogBroadcastSession : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "BroadcastSessionID", table: "MemberExpLog", type: "int", nullable: true, comment: "방송 세션 ID (리더보드 집계 대상)"); migrationBuilder.AddColumn( name: "ChannelID", table: "MemberExpLog", type: "int", nullable: true, comment: "채널 ID (channel 단위 조회용)"); migrationBuilder.AddColumn( name: "ChatExp_ChatXpPerMessage", table: "Config", type: "int", nullable: false, defaultValue: 1, comment: "채팅 1건당 지급 XP"); migrationBuilder.AddColumn( name: "ChatExp_ChatXpSessionLimit", table: "Config", type: "int", nullable: false, defaultValue: 50, comment: "방송 세션당 채팅 XP 상한"); migrationBuilder.AddColumn( name: "ChatExp_CrownTopN", table: "Config", type: "int", nullable: false, defaultValue: 3, comment: "크라운 뱃지 Top N"); migrationBuilder.AddColumn( name: "ChatExp_DonationXpPerAmount", table: "Config", type: "int", nullable: false, defaultValue: 1000, comment: "후원 N POINT당 1 XP"); migrationBuilder.AddColumn( name: "ChatExp_LeaderboardSize", table: "Config", type: "int", nullable: false, defaultValue: 50, comment: "리더보드 Top N"); migrationBuilder.AddColumn( name: "ChatExp_MinContentLength", table: "Config", type: "int", nullable: false, defaultValue: 2, comment: "XP 적립 최소 글자수"); migrationBuilder.AddColumn( name: "ChatExp_RateLimitSec", table: "Config", type: "int", nullable: false, defaultValue: 2, comment: "채팅 쿨다운(초)"); migrationBuilder.AddColumn( name: "ChatExp_UxShowLeaderboard", table: "Config", type: "bit", nullable: false, defaultValue: true, comment: "watch에서 리더보드 노출"); migrationBuilder.AddColumn( name: "ChatExp_UxShowMyXpBadge", table: "Config", type: "bit", nullable: false, defaultValue: true, comment: "내 XP 뱃지 노출"); migrationBuilder.CreateIndex( name: "IX_MemberExpLog_BroadcastSessionID_MemberID", table: "MemberExpLog", columns: new[] { "BroadcastSessionID", "MemberID" }); migrationBuilder.CreateIndex( name: "IX_MemberExpLog_ChannelID_MemberID_CreatedAt", table: "MemberExpLog", columns: new[] { "ChannelID", "MemberID", "CreatedAt" }); migrationBuilder.AddForeignKey( name: "FK_MemberExpLog_BroadcastSession_BroadcastSessionID", table: "MemberExpLog", column: "BroadcastSessionID", principalTable: "BroadcastSession", principalColumn: "ID", onDelete: ReferentialAction.NoAction); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MemberExpLog_BroadcastSession_BroadcastSessionID", table: "MemberExpLog"); migrationBuilder.DropIndex( name: "IX_MemberExpLog_BroadcastSessionID_MemberID", table: "MemberExpLog"); migrationBuilder.DropIndex( name: "IX_MemberExpLog_ChannelID_MemberID_CreatedAt", table: "MemberExpLog"); migrationBuilder.DropColumn( name: "BroadcastSessionID", table: "MemberExpLog"); migrationBuilder.DropColumn( name: "ChannelID", table: "MemberExpLog"); migrationBuilder.DropColumn( name: "ChatExp_ChatXpPerMessage", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_ChatXpSessionLimit", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_CrownTopN", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_DonationXpPerAmount", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_LeaderboardSize", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_MinContentLength", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_RateLimitSec", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_UxShowLeaderboard", table: "Config"); migrationBuilder.DropColumn( name: "ChatExp_UxShowMyXpBadge", table: "Config"); } }