feat(fundamentals): refactor entities, add Yahoo modules scraper, 52W metrics and migrations
This commit is contained in:
@@ -0,0 +1,394 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticFundamentals.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 FinlyticFundamentals.Migrations
|
||||
{
|
||||
[DbContext(typeof(FundamentalsDbContext))]
|
||||
[Migration("20260814211010_Init")]
|
||||
partial class Init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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("FinlyticCore.Entities.Settings.SettingEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("ServiceIdentifier")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("ValueJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key");
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.ToTable("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("AssetEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<decimal?>("CurrentRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DebtToEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DilutedEps")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("Ebitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EnterpriseValue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EvToEbitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardDividendYield")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FreeCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("GrossProfit")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<decimal?>("MarketCap")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("NetIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PayoutRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PegRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToBook")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToSales")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnAssets")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("RevenueGrowthYoY")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalCash")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalDebt")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalRevenue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TrailingPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("FundamentalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Payment")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("KeyExecutives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "PrimaryTicker", b1 =>
|
||||
{
|
||||
b1.Property<string>("AssetDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTicker");
|
||||
|
||||
b1.HasKey("AssetDataEntityIsin");
|
||||
|
||||
b1.ToTable("AssetData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataEntityIsin");
|
||||
});
|
||||
|
||||
b.OwnsMany("FinlyticFundamentals.Entities.TickerEntity", "AvailableTickers", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Exchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("AssetDataIsin");
|
||||
|
||||
b1.HasIndex("Ticker");
|
||||
|
||||
b1.ToTable("Tickers", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AvailableTickers");
|
||||
|
||||
b.Navigation("PrimaryTicker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("AssetEvents")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("AssetEventEntityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("AssetEventEntityId");
|
||||
|
||||
b1.ToTable("AssetEvents");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetEventEntityId");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("FundamentalData")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<string>("FundamentalDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("FundamentalDataEntityIsin");
|
||||
|
||||
b1.ToTable("FundamentalData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("FundamentalDataEntityIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("KeyExecutives")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Navigation("AssetEvents");
|
||||
|
||||
b.Navigation("FundamentalData");
|
||||
|
||||
b.Navigation("KeyExecutives");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticFundamentals.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AssetData",
|
||||
columns: table => new
|
||||
{
|
||||
Isin = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false),
|
||||
PrimaryTicker = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
|
||||
PrimaryTickerExchange = table.Column<string>(type: "text", nullable: false, defaultValue: "")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AssetData", x => x.Isin);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DynamicSettings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Key = table.Column<string>(type: "character varying(150)", maxLength: 150, nullable: false),
|
||||
ValueJson = table.Column<string>(type: "text", nullable: false),
|
||||
ServiceIdentifier = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
LastUpdatedUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DynamicSettings", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AssetEvents",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Ticker = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
|
||||
TickerExchange = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
|
||||
Type = table.Column<string>(type: "text", nullable: false),
|
||||
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
AssetDataIsin = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AssetEvents", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AssetEvents_AssetData_AssetDataIsin",
|
||||
column: x => x.AssetDataIsin,
|
||||
principalTable: "AssetData",
|
||||
principalColumn: "Isin",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FundamentalData",
|
||||
columns: table => new
|
||||
{
|
||||
Isin = table.Column<string>(type: "text", nullable: false),
|
||||
Ticker = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
|
||||
TickerExchange = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
|
||||
MarketCap = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
EnterpriseValue = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
TrailingPe = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
ForwardPe = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
PegRatio = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
PriceToSales = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
PriceToBook = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
EvToEbitda = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
TotalRevenue = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
RevenueGrowthYoY = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
GrossProfit = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
OperatingIncome = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
Ebitda = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
NetIncome = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
DilutedEps = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
TotalCash = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
TotalDebt = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
DebtToEquity = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
CurrentRatio = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
OperatingCashFlow = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
FreeCashFlow = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
ReturnOnEquity = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
ReturnOnAssets = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
ForwardDividendYield = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
PayoutRatio = table.Column<decimal>(type: "numeric", nullable: true),
|
||||
LastUpdatedUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
AssetDataIsin = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FundamentalData", x => x.Isin);
|
||||
table.ForeignKey(
|
||||
name: "FK_FundamentalData_AssetData_AssetDataIsin",
|
||||
column: x => x.AssetDataIsin,
|
||||
principalTable: "AssetData",
|
||||
principalColumn: "Isin",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "KeyExecutives",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Title = table.Column<string>(type: "text", nullable: false),
|
||||
Payment = table.Column<string>(type: "text", nullable: false),
|
||||
AssetDataIsin = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_KeyExecutives", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeyExecutives_AssetData_AssetDataIsin",
|
||||
column: x => x.AssetDataIsin,
|
||||
principalTable: "AssetData",
|
||||
principalColumn: "Isin",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tickers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Ticker = table.Column<string>(type: "text", nullable: false),
|
||||
Exchange = table.Column<string>(type: "text", nullable: false),
|
||||
AssetDataIsin = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tickers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Tickers_AssetData_AssetDataIsin",
|
||||
column: x => x.AssetDataIsin,
|
||||
principalTable: "AssetData",
|
||||
principalColumn: "Isin",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AssetEvents_AssetDataIsin",
|
||||
table: "AssetEvents",
|
||||
column: "AssetDataIsin");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DynamicSettings_Key",
|
||||
table: "DynamicSettings",
|
||||
column: "Key");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FundamentalData_AssetDataIsin",
|
||||
table: "FundamentalData",
|
||||
column: "AssetDataIsin");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeyExecutives_AssetDataIsin",
|
||||
table: "KeyExecutives",
|
||||
column: "AssetDataIsin");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tickers_AssetDataIsin",
|
||||
table: "Tickers",
|
||||
column: "AssetDataIsin");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tickers_Ticker",
|
||||
table: "Tickers",
|
||||
column: "Ticker");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AssetEvents");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DynamicSettings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "KeyExecutives");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tickers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AssetData");
|
||||
}
|
||||
}
|
||||
}
|
||||
+424
@@ -0,0 +1,424 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticFundamentals.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 FinlyticFundamentals.Migrations
|
||||
{
|
||||
[DbContext(typeof(FundamentalsDbContext))]
|
||||
[Migration("20260814214749_AddMoreFundamentalMetrics")]
|
||||
partial class AddMoreFundamentalMetrics
|
||||
{
|
||||
/// <inheritdoc />
|
||||
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("FinlyticCore.Entities.Settings.SettingEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("ServiceIdentifier")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("ValueJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key");
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.ToTable("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("AssetEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ConsensusRating")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<decimal?>("CurrentRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DebtToEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DilutedEps")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("Ebitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EnterpriseValue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EvToEbitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FiftyTwoWeekHigh")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FiftyTwoWeekLow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardDividendYield")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FreeCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("GrossProfit")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<decimal?>("MarketCap")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("NetIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PayoutRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PegRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PercentHeldByInsiders")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PercentHeldByInstitutions")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetHigh")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetLow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetMean")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToBook")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToSales")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnAssets")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("RevenueGrowthYoY")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ShortPercentOfFloat")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ShortRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalCash")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalDebt")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalRevenue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TrailingPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("FundamentalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Payment")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("KeyExecutives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "PrimaryTicker", b1 =>
|
||||
{
|
||||
b1.Property<string>("AssetDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTicker");
|
||||
|
||||
b1.HasKey("AssetDataEntityIsin");
|
||||
|
||||
b1.ToTable("AssetData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataEntityIsin");
|
||||
});
|
||||
|
||||
b.OwnsMany("FinlyticFundamentals.Entities.TickerEntity", "AvailableTickers", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Exchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("AssetDataIsin");
|
||||
|
||||
b1.HasIndex("Ticker");
|
||||
|
||||
b1.ToTable("Tickers", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AvailableTickers");
|
||||
|
||||
b.Navigation("PrimaryTicker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("AssetEvents")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("AssetEventEntityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("AssetEventEntityId");
|
||||
|
||||
b1.ToTable("AssetEvents");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetEventEntityId");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("FundamentalData")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<string>("FundamentalDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("FundamentalDataEntityIsin");
|
||||
|
||||
b1.ToTable("FundamentalData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("FundamentalDataEntityIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("KeyExecutives")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Navigation("AssetEvents");
|
||||
|
||||
b.Navigation("FundamentalData");
|
||||
|
||||
b.Navigation("KeyExecutives");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticFundamentals.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddMoreFundamentalMetrics : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ConsensusRating",
|
||||
table: "FundamentalData",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "FiftyTwoWeekHigh",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "FiftyTwoWeekLow",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PercentHeldByInsiders",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PercentHeldByInstitutions",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PriceTargetHigh",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PriceTargetLow",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "PriceTargetMean",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ShortPercentOfFloat",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ShortRatio",
|
||||
table: "FundamentalData",
|
||||
type: "numeric",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ConsensusRating",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FiftyTwoWeekHigh",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FiftyTwoWeekLow",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PercentHeldByInsiders",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PercentHeldByInstitutions",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PriceTargetHigh",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PriceTargetLow",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PriceTargetMean",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortPercentOfFloat",
|
||||
table: "FundamentalData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortRatio",
|
||||
table: "FundamentalData");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticFundamentals.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticFundamentals.Migrations
|
||||
{
|
||||
[DbContext(typeof(FundamentalsDbContext))]
|
||||
partial class FundamentalsDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("FinlyticCore.Entities.Settings.SettingEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("ServiceIdentifier")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<string>("ValueJson")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key");
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.ToTable("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("AssetEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ConsensusRating")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<decimal?>("CurrentRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DebtToEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("DilutedEps")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("Ebitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EnterpriseValue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("EvToEbitda")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FiftyTwoWeekHigh")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FiftyTwoWeekLow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardDividendYield")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ForwardPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("FreeCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("GrossProfit")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<decimal?>("MarketCap")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("NetIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingCashFlow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("OperatingIncome")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PayoutRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PegRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PercentHeldByInsiders")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PercentHeldByInstitutions")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetHigh")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetLow")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceTargetMean")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToBook")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("PriceToSales")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnAssets")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ReturnOnEquity")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("RevenueGrowthYoY")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ShortPercentOfFloat")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("ShortRatio")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalCash")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalDebt")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TotalRevenue")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.Property<decimal?>("TrailingPe")
|
||||
.HasColumnType("numeric");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("FundamentalData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Payment")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AssetDataIsin");
|
||||
|
||||
b.ToTable("KeyExecutives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "PrimaryTicker", b1 =>
|
||||
{
|
||||
b1.Property<string>("AssetDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("PrimaryTicker");
|
||||
|
||||
b1.HasKey("AssetDataEntityIsin");
|
||||
|
||||
b1.ToTable("AssetData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataEntityIsin");
|
||||
});
|
||||
|
||||
b.OwnsMany("FinlyticFundamentals.Entities.TickerEntity", "AvailableTickers", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("AssetDataIsin")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Exchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("AssetDataIsin");
|
||||
|
||||
b1.HasIndex("Ticker");
|
||||
|
||||
b1.ToTable("Tickers", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetDataIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AvailableTickers");
|
||||
|
||||
b.Navigation("PrimaryTicker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetEventEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("AssetEvents")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("AssetEventEntityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("AssetEventEntityId");
|
||||
|
||||
b1.ToTable("AssetEvents");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AssetEventEntityId");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.FundamentalDataEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("FundamentalData")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("FinlyticFundamentals.Entities.TickerEntity", "Ticker", b1 =>
|
||||
{
|
||||
b1.Property<string>("FundamentalDataEntityIsin")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Exchange")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("TickerExchange");
|
||||
|
||||
b1.Property<string>("Ticker")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("text")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("Ticker");
|
||||
|
||||
b1.HasKey("FundamentalDataEntityIsin");
|
||||
|
||||
b1.ToTable("FundamentalData");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("FundamentalDataEntityIsin");
|
||||
});
|
||||
|
||||
b.Navigation("AssetData");
|
||||
|
||||
b.Navigation("Ticker")
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.KeyExecutiveEntity", b =>
|
||||
{
|
||||
b.HasOne("FinlyticFundamentals.Entities.AssetDataEntity", "AssetData")
|
||||
.WithMany("KeyExecutives")
|
||||
.HasForeignKey("AssetDataIsin")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AssetData");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticFundamentals.Entities.AssetDataEntity", b =>
|
||||
{
|
||||
b.Navigation("AssetEvents");
|
||||
|
||||
b.Navigation("FundamentalData");
|
||||
|
||||
b.Navigation("KeyExecutives");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user