20260217184854_AddCryptoCuration.cs 3.3 KB

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