20260411210429_AddCrewWidgetConfig.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Migrations.AppDb
  5. {
  6. /// <inheritdoc />
  7. public partial class AddCrewWidgetConfig : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "CrewWidgetConfig",
  14. columns: table => new
  15. {
  16. ID = table.Column<int>(type: "int", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. ChannelID = table.Column<int>(type: "int", nullable: false),
  19. MemberID = table.Column<int>(type: "int", nullable: false),
  20. Title = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: false),
  21. Theme = table.Column<int>(type: "int", nullable: false),
  22. Period = table.Column<int>(type: "int", nullable: false),
  23. StartAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  24. EndAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  25. MaxDisplayCount = table.Column<int>(type: "int", nullable: false),
  26. IsShowAmount = table.Column<bool>(type: "bit", nullable: false),
  27. IsShowDonationCount = table.Column<bool>(type: "bit", nullable: false),
  28. IsShowContributionRate = table.Column<bool>(type: "bit", nullable: false),
  29. IsShowMemberIcon = table.Column<bool>(type: "bit", nullable: false),
  30. IsActive = table.Column<bool>(type: "bit", nullable: false),
  31. BgColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  32. TitleFontFamily = table.Column<string>(type: "nvarchar(max)", nullable: true),
  33. TitleFontSizePx = table.Column<int>(type: "int", nullable: false),
  34. TitleFontColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  35. Rank1FontFamily = table.Column<string>(type: "nvarchar(max)", nullable: true),
  36. Rank1FontSizePx = table.Column<int>(type: "int", nullable: false),
  37. Rank1FontColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  38. Rank2FontFamily = table.Column<string>(type: "nvarchar(max)", nullable: true),
  39. Rank2FontSizePx = table.Column<int>(type: "int", nullable: false),
  40. Rank2FontColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  41. Rank3FontFamily = table.Column<string>(type: "nvarchar(max)", nullable: true),
  42. Rank3FontSizePx = table.Column<int>(type: "int", nullable: false),
  43. Rank3FontColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  44. RowFontFamily = table.Column<string>(type: "nvarchar(max)", nullable: true),
  45. RowFontSizePx = table.Column<int>(type: "int", nullable: false),
  46. RowFontColor = table.Column<string>(type: "nvarchar(7)", maxLength: 7, nullable: false),
  47. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  48. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  49. },
  50. constraints: table =>
  51. {
  52. table.PrimaryKey("PK_CrewWidgetConfig", x => x.ID);
  53. table.ForeignKey(
  54. name: "FK_CrewWidgetConfig_Channel_ChannelID",
  55. column: x => x.ChannelID,
  56. principalTable: "Channel",
  57. principalColumn: "ID",
  58. onDelete: ReferentialAction.Cascade);
  59. table.ForeignKey(
  60. name: "FK_CrewWidgetConfig_Member_MemberID",
  61. column: x => x.MemberID,
  62. principalTable: "Member",
  63. principalColumn: "ID");
  64. },
  65. comment: "크루 위젯 설정");
  66. migrationBuilder.CreateIndex(
  67. name: "IX_CrewWidgetConfig_ChannelID",
  68. table: "CrewWidgetConfig",
  69. column: "ChannelID");
  70. migrationBuilder.CreateIndex(
  71. name: "IX_CrewWidgetConfig_MemberID",
  72. table: "CrewWidgetConfig",
  73. column: "MemberID");
  74. }
  75. /// <inheritdoc />
  76. protected override void Down(MigrationBuilder migrationBuilder)
  77. {
  78. migrationBuilder.DropTable(
  79. name: "CrewWidgetConfig");
  80. }
  81. }
  82. }