//
using System;
using FinlyticBot.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticBot.Migrations
{
[DbContext(typeof(BotDbContext))]
[Migration("20260819191434_InitialBotMigration")]
partial class InitialBotMigration
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("FinlyticBot.Database.Entities.BotPortfolioSnapshotEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CashEur")
.HasColumnType("decimal(18,4)");
b.Property("CreatedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("DailyRealizedPnlEur")
.HasColumnType("decimal(18,4)");
b.Property("OpenPositionsCount")
.HasColumnType("integer");
b.Property("SnapshotDateUtc")
.HasColumnType("timestamp with time zone");
b.Property("TotalEquityEur")
.HasColumnType("decimal(18,4)");
b.Property("TotalUnrealizedPnlEur")
.HasColumnType("decimal(18,4)");
b.Property("WinRatePercent")
.HasColumnType("decimal(6,2)");
b.HasKey("Id");
b.HasIndex("SnapshotDateUtc");
b.ToTable("bot_portfolio_snapshots");
});
modelBuilder.Entity("FinlyticBot.Database.Entities.BotPositionEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AlpacaOrderId")
.HasMaxLength(60)
.HasColumnType("character varying(60)");
b.Property("AverageBuyIn")
.HasColumnType("decimal(18,4)");
b.Property("ClientOrderId")
.HasMaxLength(60)
.HasColumnType("character varying(60)");
b.Property("ClosedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("CurrentPrice")
.HasColumnType("decimal(18,4)");
b.Property("CurrentStopLoss")
.HasColumnType("decimal(18,4)");
b.Property("Direction")
.HasColumnType("integer");
b.Property("EntryPrice")
.HasColumnType("decimal(18,4)");
b.Property("ExitPlan")
.IsRequired()
.HasColumnType("jsonb");
b.Property("InitialStopLoss")
.HasColumnType("decimal(18,4)");
b.Property("Isin")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("LastSyncAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("OpenedAtUtc")
.HasColumnType("timestamp with time zone");
b.Property("ProposalId")
.HasColumnType("uuid");
b.Property("Quantity")
.HasColumnType("decimal(18,4)");
b.Property("RealizedPnlEur")
.HasColumnType("decimal(18,4)");
b.Property("Status")
.HasColumnType("integer");
b.Property("Symbol")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property("TakeProfit1")
.HasColumnType("decimal(18,4)");
b.Property("TakeProfit2")
.HasColumnType("decimal(18,4)");
b.Property("TotalFeesEur")
.HasColumnType("decimal(18,4)");
b.Property("Venue")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("OpenedAtUtc");
b.HasIndex("ProposalId");
b.HasIndex("Status", "Venue");
b.ToTable("bot_positions");
});
modelBuilder.Entity("FinlyticCore.Entities.Settings.SettingEntity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property("LastUpdatedUtc")
.HasColumnType("timestamp with time zone");
b.Property("ServiceIdentifier")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property("ValueJson")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("DynamicSettings");
});
#pragma warning restore 612, 618
}
}
}