20260327084345_UpdateDonateAlert.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb;
  4. /// <inheritdoc />
  5. public partial class UpdateDonateAlert : Migration
  6. {
  7. /// <inheritdoc />
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.RenameColumn(
  11. name: "ThumbnailUrl",
  12. table: "DonationAlertConfig",
  13. newName: "SoundUrl");
  14. migrationBuilder.RenameColumn(
  15. name: "Sound",
  16. table: "DonationAlertConfig",
  17. newName: "ImageUrl");
  18. migrationBuilder.RenameColumn(
  19. name: "EnableThumbnail",
  20. table: "DonationAlertConfig",
  21. newName: "EnableSound");
  22. migrationBuilder.AddColumn<string>(
  23. name: "AmountFontColor",
  24. table: "DonationAlertConfig",
  25. type: "nvarchar(20)",
  26. maxLength: 20,
  27. nullable: false,
  28. defaultValue: "");
  29. migrationBuilder.AddColumn<string>(
  30. name: "AmountFontFamily",
  31. table: "DonationAlertConfig",
  32. type: "nvarchar(100)",
  33. maxLength: 100,
  34. nullable: true);
  35. migrationBuilder.AddColumn<int>(
  36. name: "AmountFontSize",
  37. table: "DonationAlertConfig",
  38. type: "int",
  39. nullable: false,
  40. defaultValue: 0);
  41. migrationBuilder.AddColumn<bool>(
  42. name: "EnableImage",
  43. table: "DonationAlertConfig",
  44. type: "bit",
  45. nullable: false,
  46. defaultValue: false);
  47. migrationBuilder.AddColumn<int>(
  48. name: "MatchType",
  49. table: "DonationAlertConfig",
  50. type: "int",
  51. nullable: false,
  52. defaultValue: 0);
  53. migrationBuilder.AddColumn<string>(
  54. name: "MessageFontColor",
  55. table: "DonationAlertConfig",
  56. type: "nvarchar(20)",
  57. maxLength: 20,
  58. nullable: false,
  59. defaultValue: "");
  60. migrationBuilder.AddColumn<string>(
  61. name: "MessageFontFamily",
  62. table: "DonationAlertConfig",
  63. type: "nvarchar(100)",
  64. maxLength: 100,
  65. nullable: true);
  66. migrationBuilder.AddColumn<int>(
  67. name: "MessageFontSize",
  68. table: "DonationAlertConfig",
  69. type: "int",
  70. nullable: false,
  71. defaultValue: 0);
  72. migrationBuilder.AddColumn<string>(
  73. name: "NicknameFontColor",
  74. table: "DonationAlertConfig",
  75. type: "nvarchar(20)",
  76. maxLength: 20,
  77. nullable: false,
  78. defaultValue: "");
  79. migrationBuilder.AddColumn<string>(
  80. name: "NicknameFontFamily",
  81. table: "DonationAlertConfig",
  82. type: "nvarchar(100)",
  83. maxLength: 100,
  84. nullable: true);
  85. migrationBuilder.AddColumn<int>(
  86. name: "NicknameFontSize",
  87. table: "DonationAlertConfig",
  88. type: "int",
  89. nullable: false,
  90. defaultValue: 0);
  91. migrationBuilder.AddColumn<string>(
  92. name: "PopupEffect",
  93. table: "DonationAlertConfig",
  94. type: "nvarchar(50)",
  95. maxLength: 50,
  96. nullable: true);
  97. migrationBuilder.AddColumn<string>(
  98. name: "TextEffect",
  99. table: "DonationAlertConfig",
  100. type: "nvarchar(50)",
  101. maxLength: 50,
  102. nullable: true);
  103. migrationBuilder.CreateIndex(
  104. name: "IX_DonationAlertConfig_ChannelID_MatchType_Amount",
  105. table: "DonationAlertConfig",
  106. columns: new[] { "ChannelID", "MatchType", "Amount" });
  107. }
  108. /// <inheritdoc />
  109. protected override void Down(MigrationBuilder migrationBuilder)
  110. {
  111. migrationBuilder.DropIndex(
  112. name: "IX_DonationAlertConfig_ChannelID_MatchType_Amount",
  113. table: "DonationAlertConfig");
  114. migrationBuilder.DropColumn(
  115. name: "AmountFontColor",
  116. table: "DonationAlertConfig");
  117. migrationBuilder.DropColumn(
  118. name: "AmountFontFamily",
  119. table: "DonationAlertConfig");
  120. migrationBuilder.DropColumn(
  121. name: "AmountFontSize",
  122. table: "DonationAlertConfig");
  123. migrationBuilder.DropColumn(
  124. name: "EnableImage",
  125. table: "DonationAlertConfig");
  126. migrationBuilder.DropColumn(
  127. name: "MatchType",
  128. table: "DonationAlertConfig");
  129. migrationBuilder.DropColumn(
  130. name: "MessageFontColor",
  131. table: "DonationAlertConfig");
  132. migrationBuilder.DropColumn(
  133. name: "MessageFontFamily",
  134. table: "DonationAlertConfig");
  135. migrationBuilder.DropColumn(
  136. name: "MessageFontSize",
  137. table: "DonationAlertConfig");
  138. migrationBuilder.DropColumn(
  139. name: "NicknameFontColor",
  140. table: "DonationAlertConfig");
  141. migrationBuilder.DropColumn(
  142. name: "NicknameFontFamily",
  143. table: "DonationAlertConfig");
  144. migrationBuilder.DropColumn(
  145. name: "NicknameFontSize",
  146. table: "DonationAlertConfig");
  147. migrationBuilder.DropColumn(
  148. name: "PopupEffect",
  149. table: "DonationAlertConfig");
  150. migrationBuilder.DropColumn(
  151. name: "TextEffect",
  152. table: "DonationAlertConfig");
  153. migrationBuilder.RenameColumn(
  154. name: "SoundUrl",
  155. table: "DonationAlertConfig",
  156. newName: "ThumbnailUrl");
  157. migrationBuilder.RenameColumn(
  158. name: "ImageUrl",
  159. table: "DonationAlertConfig",
  160. newName: "Sound");
  161. migrationBuilder.RenameColumn(
  162. name: "EnableSound",
  163. table: "DonationAlertConfig",
  164. newName: "EnableThumbnail");
  165. }
  166. }