using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Infrastructure.Migrations.AppDb
{
    /// <inheritdoc />
    public partial class AddCryptoCuration : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "Crypto_MainPageCoinCount",
                table: "Config",
                type: "int",
                nullable: false,
                defaultValue: 10,
                comment: "메인 페이지 기본 표시 코인 수");

            migrationBuilder.AddColumn<decimal>(
                name: "Crypto_PlungeThreshold",
                table: "Config",
                type: "decimal(5,2)",
                nullable: false,
                defaultValue: -5.0m,
                comment: "급락 임계값 (%)");

            migrationBuilder.AddColumn<decimal>(
                name: "Crypto_SurgeThreshold",
                table: "Config",
                type: "decimal(5,2)",
                nullable: false,
                defaultValue: 5.0m,
                comment: "급등 임계값 (%)");

            migrationBuilder.AddColumn<int>(
                name: "Crypto_TickerRefreshSeconds",
                table: "Config",
                type: "int",
                nullable: false,
                defaultValue: 5,
                comment: "시세 업데이트 주기 (초)");

            migrationBuilder.AddColumn<short>(
                name: "DisplayOrder",
                table: "Coin",
                type: "smallint",
                nullable: false,
                defaultValue: (short)0,
                comment: "메인 노출 순서");

            migrationBuilder.AddColumn<bool>(
                name: "IsFeatured",
                table: "Coin",
                type: "bit",
                nullable: false,
                defaultValue: false,
                comment: "주요 코인 (메인 노출)");

            migrationBuilder.CreateIndex(
                name: "IX_Coin_DisplayOrder",
                table: "Coin",
                column: "DisplayOrder");

            migrationBuilder.CreateIndex(
                name: "IX_Coin_IsFeatured",
                table: "Coin",
                column: "IsFeatured");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Coin_DisplayOrder",
                table: "Coin");

            migrationBuilder.DropIndex(
                name: "IX_Coin_IsFeatured",
                table: "Coin");

            migrationBuilder.DropColumn(
                name: "Crypto_MainPageCoinCount",
                table: "Config");

            migrationBuilder.DropColumn(
                name: "Crypto_PlungeThreshold",
                table: "Config");

            migrationBuilder.DropColumn(
                name: "Crypto_SurgeThreshold",
                table: "Config");

            migrationBuilder.DropColumn(
                name: "Crypto_TickerRefreshSeconds",
                table: "Config");

            migrationBuilder.DropColumn(
                name: "DisplayOrder",
                table: "Coin");

            migrationBuilder.DropColumn(
                name: "IsFeatured",
                table: "Coin");
        }
    }
}
