20260411210429_AddCrewWidgetConfig.cs 4.4 KB

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