20260217184854_AddCryptoCuration.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb;
  4. /// <inheritdoc />
  5. public partial class AddCryptoCuration : Migration
  6. {
  7. /// <inheritdoc />
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.AddColumn<int>(
  11. name: "Crypto_MainPageCoinCount",
  12. table: "Config",
  13. type: "int",
  14. nullable: false,
  15. defaultValue: 10,
  16. comment: "메인 페이지 기본 표시 코인 수");
  17. migrationBuilder.AddColumn<decimal>(
  18. name: "Crypto_PlungeThreshold",
  19. table: "Config",
  20. type: "decimal(5,2)",
  21. nullable: false,
  22. defaultValue: -5.0m,
  23. comment: "급락 임계값 (%)");
  24. migrationBuilder.AddColumn<decimal>(
  25. name: "Crypto_SurgeThreshold",
  26. table: "Config",
  27. type: "decimal(5,2)",
  28. nullable: false,
  29. defaultValue: 5.0m,
  30. comment: "급등 임계값 (%)");
  31. migrationBuilder.AddColumn<int>(
  32. name: "Crypto_TickerRefreshSeconds",
  33. table: "Config",
  34. type: "int",
  35. nullable: false,
  36. defaultValue: 5,
  37. comment: "시세 업데이트 주기 (초)");
  38. migrationBuilder.AddColumn<short>(
  39. name: "DisplayOrder",
  40. table: "Coin",
  41. type: "smallint",
  42. nullable: false,
  43. defaultValue: (short)0,
  44. comment: "메인 노출 순서");
  45. migrationBuilder.AddColumn<bool>(
  46. name: "IsFeatured",
  47. table: "Coin",
  48. type: "bit",
  49. nullable: false,
  50. defaultValue: false,
  51. comment: "주요 코인 (메인 노출)");
  52. migrationBuilder.CreateIndex(
  53. name: "IX_Coin_DisplayOrder",
  54. table: "Coin",
  55. column: "DisplayOrder");
  56. migrationBuilder.CreateIndex(
  57. name: "IX_Coin_IsFeatured",
  58. table: "Coin",
  59. column: "IsFeatured");
  60. }
  61. /// <inheritdoc />
  62. protected override void Down(MigrationBuilder migrationBuilder)
  63. {
  64. migrationBuilder.DropIndex(
  65. name: "IX_Coin_DisplayOrder",
  66. table: "Coin");
  67. migrationBuilder.DropIndex(
  68. name: "IX_Coin_IsFeatured",
  69. table: "Coin");
  70. migrationBuilder.DropColumn(
  71. name: "Crypto_MainPageCoinCount",
  72. table: "Config");
  73. migrationBuilder.DropColumn(
  74. name: "Crypto_PlungeThreshold",
  75. table: "Config");
  76. migrationBuilder.DropColumn(
  77. name: "Crypto_SurgeThreshold",
  78. table: "Config");
  79. migrationBuilder.DropColumn(
  80. name: "Crypto_TickerRefreshSeconds",
  81. table: "Config");
  82. migrationBuilder.DropColumn(
  83. name: "DisplayOrder",
  84. table: "Coin");
  85. migrationBuilder.DropColumn(
  86. name: "IsFeatured",
  87. table: "Coin");
  88. }
  89. }