Files
managing-apps/src/Managing.Infrastructure.Database/Migrations/20250723221025_UpdateBotBackupDataToText.Designer.cs
Oda 422fecea7b Postgres (#30)
* Add postgres

* Migrate users

* Migrate geneticRequest

* Try to fix Concurrent call

* Fix asyncawait

* Fix async and concurrent

* Migrate backtests

* Add cache for user by address

* Fix backtest migration

* Fix not open connection

* Fix backtest command error

* Fix concurrent

* Fix all concurrency

* Migrate TradingRepo

* Fix scenarios

* Migrate statistic repo

* Save botbackup

* Add settings et moneymanagement

* Add bot postgres

* fix a bit more backups

* Fix bot model

* Fix loading backup

* Remove cache market for read positions

* Add workers to postgre

* Fix workers api

* Reduce get Accounts for workers

* Migrate synth to postgre

* Fix backtest saved

* Remove mongodb

* botservice decorrelation

* Fix tradingbot scope call

* fix tradingbot

* fix concurrent

* Fix scope for genetics

* Fix account over requesting

* Fix bundle backtest worker

* fix a lot of things

* fix tab backtest

* Remove optimized moneymanagement

* Add light signal to not use User and too much property

* Make money management lighter

* insert indicators to awaitable

* Migrate add strategies to await

* Refactor scenario and indicator retrieval to use asynchronous methods throughout the application

* add more async await

* Add services

* Fix and clean

* Fix bot a bit

* Fix bot and add message for cooldown

* Remove fees

* Add script to deploy db

* Update dfeeploy script

* fix script

* Add idempotent script and backup

* finish script migration

* Fix did user and agent name on start bot
2025-07-27 20:42:17 +07:00

1225 lines
43 KiB
C#

// <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("20250723221025_UpdateBotBackupDataToText")]
partial class UpdateBotBackupDataToText
{
/// <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")
.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("Key");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("UserId");
b.ToTable("Accounts");
});
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>("OptimizedMoneyManagementJson")
.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("character varying(1000)");
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<string>("UserName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<int>("WinRate")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("EndDate");
b.HasIndex("FinalPnl");
b.HasIndex("Identifier")
.IsUnique();
b.HasIndex("RequestId");
b.HasIndex("Score");
b.HasIndex("StartDate");
b.HasIndex("UserName");
b.HasIndex("WinRate");
b.HasIndex("RequestId", "Score");
b.HasIndex("UserName", "Score");
b.ToTable("Backtests");
});
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.BotBackupEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Data")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Identifier")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<int>("LastStatus")
.HasColumnType("integer");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CreateDate");
b.HasIndex("Identifier")
.IsUnique();
b.HasIndex("LastStatus");
b.HasIndex("UserName");
b.HasIndex("UserName", "CreateDate");
b.ToTable("BotBackups");
});
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<string>("UserName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CompletedAt");
b.HasIndex("CreatedAt");
b.HasIndex("RequestId")
.IsUnique();
b.HasIndex("Status");
b.HasIndex("UserName");
b.HasIndex("UserName", "CreatedAt");
b.ToTable("BundleBacktestRequests");
});
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.FeeEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("Cost")
.HasColumnType("decimal(18,8)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Exchange")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("LastUpdate")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Exchange")
.IsUnique();
b.HasIndex("LastUpdate");
b.ToTable("Fees");
});
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("Direction");
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("CreatedAt");
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<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Name");
b.HasIndex("Type");
b.HasIndex("UserName");
b.HasIndex("UserName", "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<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("Name");
b.HasIndex("UserName");
b.HasIndex("UserName", "Name");
b.ToTable("MoneyManagements");
});
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.PositionEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
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>("Identifier")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("Initiator")
.IsRequired()
.HasColumnType("text");
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<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Date");
b.HasIndex("Identifier")
.IsUnique();
b.HasIndex("Initiator");
b.HasIndex("OpenTradeId");
b.HasIndex("Status");
b.HasIndex("StopLossTradeId");
b.HasIndex("TakeProfit1TradeId");
b.HasIndex("TakeProfit2TradeId");
b.HasIndex("UserName");
b.HasIndex("UserName", "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<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Name");
b.HasIndex("UserName");
b.HasIndex("UserName", "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");
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<string>("UserName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Date");
b.HasIndex("Identifier");
b.HasIndex("Status");
b.HasIndex("Ticker");
b.HasIndex("UserName");
b.HasIndex("UserName", "Date");
b.HasIndex("Identifier", "Date", "UserName")
.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("ScenarioCount");
b.HasIndex("DateTime", "ScenarioCount");
b.ToTable("SpotlightOverviews");
});
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("Rank");
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("CreatedAt");
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.ToTable("Users");
});
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.AccountEntity", 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.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.Navigation("OpenTrade");
b.Navigation("StopLossTrade");
b.Navigation("TakeProfit1Trade");
b.Navigation("TakeProfit2Trade");
});
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.IndicatorEntity", b =>
{
b.Navigation("ScenarioIndicators");
});
modelBuilder.Entity("Managing.Infrastructure.Databases.PostgreSql.Entities.ScenarioEntity", b =>
{
b.Navigation("ScenarioIndicators");
});
#pragma warning restore 612, 618
}
}
}