using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Managing.Infrastructure.Databases.Migrations
{
    /// <inheritdoc />
    public partial class UpdateAgentSummaryEntityIndexes : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_AgentSummaries_AgentName",
                table: "AgentSummaries");

            migrationBuilder.AlterColumn<decimal>(
                name: "TotalFees",
                table: "AgentSummaries",
                type: "numeric(18,8)",
                precision: 18,
                scale: 8,
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric");

            migrationBuilder.AlterColumn<decimal>(
                name: "NetPnL",
                table: "AgentSummaries",
                type: "numeric(18,8)",
                precision: 18,
                scale: 8,
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric");

            migrationBuilder.CreateIndex(
                name: "IX_AgentSummaries_AgentName",
                table: "AgentSummaries",
                column: "AgentName",
                unique: true);
        }

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

            migrationBuilder.AlterColumn<decimal>(
                name: "TotalFees",
                table: "AgentSummaries",
                type: "numeric",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric(18,8)",
                oldPrecision: 18,
                oldScale: 8);

            migrationBuilder.AlterColumn<decimal>(
                name: "NetPnL",
                table: "AgentSummaries",
                type: "numeric",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "numeric(18,8)",
                oldPrecision: 18,
                oldScale: 8);

            migrationBuilder.CreateIndex(
                name: "IX_AgentSummaries_AgentName",
                table: "AgentSummaries",
                column: "AgentName");
        }
    }
}
