20260327084345_UpdateDonateAlert.cs 6.5 KB

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