// <auto-generated />
using System;
using Managing.Infrastructure.Databases.PostgreSql;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Managing.Infrastructure.Databases.Migrations
{
    [DbContext(typeof(ManagingDbContext))]
    [Migration("20250815134309_AddTotalBalanceToAgent")]
    partial class AddTotalBalanceToAgent
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.11")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.AccountEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Exchange")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("Secret")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.HasIndex("UserId");

                    b.ToTable("Accounts");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.AgentSummaryEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int>("ActiveStrategiesCount")
                        .HasColumnType("integer");

                    b.Property<string>("AgentName")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Losses")
                        .HasColumnType("integer");

                    b.Property<DateTime?>("Runtime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("TotalBalance")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.Property<decimal>("TotalPnL")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("TotalROI")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("TotalVolume")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.Property<int>("Wins")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("AgentName");

                    b.HasIndex("TotalPnL");

                    b.HasIndex("UserId")
                        .IsUnique();

                    b.ToTable("AgentSummaries");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BacktestEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ConfigJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("EndDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("Fees")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("FinalPnl")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("GrowthPercentage")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("HodlPercentage")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("Identifier")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("Metadata")
                        .HasColumnType("text");

                    b.Property<string>("MoneyManagementJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("PositionsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("RequestId")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<double>("Score")
                        .HasColumnType("double precision");

                    b.Property<string>("ScoreMessage")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("text");

                    b.Property<string>("SignalsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("StartDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("StatisticsJson")
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.Property<int>("WinRate")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("Identifier")
                        .IsUnique();

                    b.HasIndex("RequestId");

                    b.HasIndex("Score");

                    b.HasIndex("UserId");

                    b.HasIndex("RequestId", "Score");

                    b.HasIndex("UserId", "Score");

                    b.ToTable("Backtests");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BotEntity", b =>
                {
                    b.Property<Guid>("Identifier")
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(255)
                        .HasColumnType("uuid");

                    b.Property<DateTime>("CreateDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("Fees")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.Property<int>("LongPositionCount")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<decimal>("Pnl")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.Property<decimal>("Roi")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.Property<int>("ShortPositionCount")
                        .HasColumnType("integer");

                    b.Property<DateTime>("StartupTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("Ticker")
                        .HasColumnType("integer");

                    b.Property<int>("TradeLosses")
                        .HasColumnType("integer");

                    b.Property<int>("TradeWins")
                        .HasColumnType("integer");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.Property<decimal>("Volume")
                        .HasPrecision(18, 8)
                        .HasColumnType("numeric(18,8)");

                    b.HasKey("Identifier");

                    b.HasIndex("Identifier")
                        .IsUnique();

                    b.HasIndex("Status");

                    b.HasIndex("UserId");

                    b.ToTable("Bots");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BundleBacktestRequestEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("BacktestRequestsJson")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("CompletedBacktests")
                        .HasColumnType("integer");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("CurrentBacktest")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)");

                    b.Property<string>("ErrorMessage")
                        .HasColumnType("text");

                    b.Property<int?>("EstimatedTimeRemainingSeconds")
                        .HasColumnType("integer");

                    b.Property<int>("FailedBacktests")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("ProgressInfo")
                        .HasColumnType("text");

                    b.Property<string>("RequestId")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("ResultsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("TotalBacktests")
                        .HasColumnType("integer");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("RequestId")
                        .IsUnique();

                    b.HasIndex("Status");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "CreatedAt");

                    b.ToTable("BundleBacktestRequests");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.FundingRateEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Direction")
                        .HasColumnType("integer");

                    b.Property<int>("Exchange")
                        .HasColumnType("integer");

                    b.Property<decimal>("OpenInterest")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("Rate")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<int>("Ticker")
                        .HasColumnType("integer");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("Date");

                    b.HasIndex("Exchange");

                    b.HasIndex("Ticker");

                    b.HasIndex("Exchange", "Date");

                    b.HasIndex("Ticker", "Exchange");

                    b.HasIndex("Ticker", "Exchange", "Date")
                        .IsUnique();

                    b.ToTable("FundingRates");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.GeneticRequestEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<decimal>("Balance")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("BestChromosome")
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)");

                    b.Property<double?>("BestFitness")
                        .HasColumnType("double precision");

                    b.Property<double?>("BestFitnessSoFar")
                        .HasColumnType("double precision");

                    b.Property<string>("BestIndividual")
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("CrossoverMethod")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("CurrentGeneration")
                        .HasColumnType("integer");

                    b.Property<string>("EligibleIndicatorsJson")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)");

                    b.Property<int>("ElitismPercentage")
                        .HasColumnType("integer");

                    b.Property<DateTime>("EndDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("character varying(2000)");

                    b.Property<int>("Generations")
                        .HasColumnType("integer");

                    b.Property<double>("MaxTakeProfit")
                        .HasColumnType("double precision");

                    b.Property<string>("MutationMethod")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<double>("MutationRate")
                        .HasColumnType("double precision");

                    b.Property<int>("PopulationSize")
                        .HasColumnType("integer");

                    b.Property<string>("ProgressInfo")
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)");

                    b.Property<string>("RequestId")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("SelectionMethod")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("StartDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<string>("Ticker")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Timeframe")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime?>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("RequestId")
                        .IsUnique();

                    b.HasIndex("Status");

                    b.HasIndex("UserId");

                    b.ToTable("GeneticRequests");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.IndicatorEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("CyclePeriods")
                        .HasColumnType("integer");

                    b.Property<int?>("FastPeriods")
                        .HasColumnType("integer");

                    b.Property<int>("MinimumHistory")
                        .HasColumnType("integer");

                    b.Property<double?>("Multiplier")
                        .HasColumnType("double precision");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<int?>("Period")
                        .HasColumnType("integer");

                    b.Property<int?>("SignalPeriods")
                        .HasColumnType("integer");

                    b.Property<string>("SignalType")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int?>("SlowPeriods")
                        .HasColumnType("integer");

                    b.Property<int?>("SmoothPeriods")
                        .HasColumnType("integer");

                    b.Property<int?>("StochPeriods")
                        .HasColumnType("integer");

                    b.Property<string>("Timeframe")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "Name");

                    b.ToTable("Indicators");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.MoneyManagementEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("Leverage")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<decimal>("StopLoss")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("TakeProfit")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("Timeframe")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.Property<string>("UserName")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("UserName");

                    b.HasIndex("UserName", "Name");

                    b.ToTable("MoneyManagements");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.PositionEntity", b =>
                {
                    b.Property<Guid>("Identifier")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("AccountName")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Initiator")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<Guid>("InitiatorIdentifier")
                        .HasColumnType("uuid");

                    b.Property<string>("MoneyManagementJson")
                        .HasColumnType("text");

                    b.Property<int?>("OpenTradeId")
                        .HasColumnType("integer");

                    b.Property<string>("OriginDirection")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<decimal>("ProfitAndLoss")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("SignalIdentifier")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int?>("StopLossTradeId")
                        .HasColumnType("integer");

                    b.Property<int?>("TakeProfit1TradeId")
                        .HasColumnType("integer");

                    b.Property<int?>("TakeProfit2TradeId")
                        .HasColumnType("integer");

                    b.Property<string>("Ticker")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Identifier");

                    b.HasIndex("Identifier")
                        .IsUnique();

                    b.HasIndex("InitiatorIdentifier");

                    b.HasIndex("OpenTradeId");

                    b.HasIndex("Status");

                    b.HasIndex("StopLossTradeId");

                    b.HasIndex("TakeProfit1TradeId");

                    b.HasIndex("TakeProfit2TradeId");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "Identifier");

                    b.ToTable("Positions");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("LoopbackPeriod")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "Name");

                    b.ToTable("Scenarios");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioIndicatorEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("IndicatorId")
                        .HasColumnType("integer");

                    b.Property<int>("ScenarioId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("IndicatorId");

                    b.HasIndex("ScenarioId", "IndicatorId")
                        .IsUnique();

                    b.ToTable("ScenarioIndicators");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.SignalEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("CandleJson")
                        .HasColumnType("text");

                    b.Property<string>("Confidence")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Direction")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Identifier")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("IndicatorName")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("SignalType")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Ticker")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Timeframe")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("UserId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("Date");

                    b.HasIndex("Identifier");

                    b.HasIndex("Status");

                    b.HasIndex("Ticker");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "Date");

                    b.HasIndex("Identifier", "Date", "UserId")
                        .IsUnique();

                    b.ToTable("Signals");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.SpotlightOverviewEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("DateTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<Guid>("Identifier")
                        .HasColumnType("uuid");

                    b.Property<int>("ScenarioCount")
                        .HasColumnType("integer");

                    b.Property<string>("SpotlightsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("DateTime");

                    b.HasIndex("Identifier")
                        .IsUnique();

                    b.HasIndex("DateTime", "ScenarioCount");

                    b.ToTable("SpotlightOverviews");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.SynthMinersLeaderboardEntity", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Asset")
                        .IsRequired()
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)");

                    b.Property<string>("CacheKey")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsBacktest")
                        .HasColumnType("boolean");

                    b.Property<string>("MinersData")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime?>("SignalDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("TimeIncrement")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("CacheKey")
                        .IsUnique();

                    b.ToTable("SynthMinersLeaderboards");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.SynthPredictionEntity", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<string>("Asset")
                        .IsRequired()
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)");

                    b.Property<string>("CacheKey")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsBacktest")
                        .HasColumnType("boolean");

                    b.Property<int>("MinerUid")
                        .HasColumnType("integer");

                    b.Property<string>("PredictionData")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime?>("SignalDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("TimeIncrement")
                        .HasColumnType("integer");

                    b.Property<int>("TimeLength")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("CacheKey")
                        .IsUnique();

                    b.ToTable("SynthPredictions");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.TopVolumeTickerEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Exchange")
                        .HasColumnType("integer");

                    b.Property<int>("Rank")
                        .HasColumnType("integer");

                    b.Property<int>("Ticker")
                        .HasColumnType("integer");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("Volume")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.HasKey("Id");

                    b.HasIndex("Date");

                    b.HasIndex("Exchange");

                    b.HasIndex("Ticker");

                    b.HasIndex("Date", "Rank");

                    b.HasIndex("Exchange", "Date");

                    b.ToTable("TopVolumeTickers");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.TradeEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("Date")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Direction")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ExchangeOrderId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<decimal>("Fee")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("Leverage")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("Message")
                        .HasColumnType("text");

                    b.Property<decimal>("Price")
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("Quantity")
                        .HasColumnType("decimal(18,8)");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("Ticker")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("TradeType")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("Date");

                    b.HasIndex("ExchangeOrderId");

                    b.HasIndex("Status");

                    b.ToTable("Trades");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.TraderEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Address")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<decimal>("AverageLoss")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("AverageWin")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsBestTrader")
                        .HasColumnType("boolean");

                    b.Property<decimal>("Pnl")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<decimal>("Roi")
                        .HasPrecision(18, 8)
                        .HasColumnType("decimal(18,8)");

                    b.Property<int>("TradeCount")
                        .HasColumnType("integer");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Winrate")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("Address");

                    b.HasIndex("IsBestTrader");

                    b.HasIndex("Pnl");

                    b.HasIndex("Roi");

                    b.HasIndex("Winrate");

                    b.HasIndex("Address", "IsBestTrader")
                        .IsUnique();

                    b.HasIndex("IsBestTrader", "Roi");

                    b.HasIndex("IsBestTrader", "Winrate");

                    b.ToTable("Traders");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("AgentName")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("AvatarUrl")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.Property<string>("TelegramChannel")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("Users");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.WorkerEntity", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<long>("DelayTicks")
                        .HasColumnType("bigint");

                    b.Property<int>("ExecutionCount")
                        .HasColumnType("integer");

                    b.Property<bool>("IsActive")
                        .HasColumnType("boolean");

                    b.Property<DateTime?>("LastRunTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("StartTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("WorkerType")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("WorkerType")
                        .IsUnique();

                    b.ToTable("Workers");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.AccountEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.AgentSummaryEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BacktestEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BotEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BundleBacktestRequestEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.GeneticRequestEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.IndicatorEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.MoneyManagementEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.PositionEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.TradeEntity", "OpenTrade")
                        .WithMany()
                        .HasForeignKey("OpenTradeId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.TradeEntity", "StopLossTrade")
                        .WithMany()
                        .HasForeignKey("StopLossTradeId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.TradeEntity", "TakeProfit1Trade")
                        .WithMany()
                        .HasForeignKey("TakeProfit1TradeId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.TradeEntity", "TakeProfit2Trade")
                        .WithMany()
                        .HasForeignKey("TakeProfit2TradeId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("OpenTrade");

                    b.Navigation("StopLossTrade");

                    b.Navigation("TakeProfit1Trade");

                    b.Navigation("TakeProfit2Trade");

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioIndicatorEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.IndicatorEntity", "Indicator")
                        .WithMany("ScenarioIndicators")
                        .HasForeignKey("IndicatorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioEntity", "Scenario")
                        .WithMany("ScenarioIndicators")
                        .HasForeignKey("ScenarioId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Indicator");

                    b.Navigation("Scenario");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.SignalEntity", b =>
                {
                    b.HasOne("Managing.Infrastructure.Databases.PostgreSql.Entities.UserEntity", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("User");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.IndicatorEntity", b =>
                {
                    b.Navigation("ScenarioIndicators");
                });

            modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioEntity", b =>
                {
                    b.Navigation("ScenarioIndicators");
                });
#pragma warning restore 612, 618
        }
    }
}
