feat(Assets): update asset services and background workers

This commit is contained in:
2026-08-09 21:01:39 +02:00
parent b57cc9894c
commit e0778b88ea
32 changed files with 1020 additions and 2062 deletions
-285
View File
@@ -1,285 +0,0 @@
// <auto-generated />
using System;
using FinlyticAssets.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 FinlyticAssets.Migrations
{
[DbContext(typeof(AssetsDbContext))]
[Migration("20260628184437_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("AssetEntityTagEntity", b =>
{
b.Property<string>("AssetsIsin")
.HasColumnType("text");
b.Property<string>("TagsId")
.HasColumnType("text");
b.HasKey("AssetsIsin", "TagsId");
b.HasIndex("TagsId");
b.ToTable("AssetEntityTagEntity");
});
modelBuilder.Entity("FinlyticAssets.Entities.Settings", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AssetUpdateTypeDelay")
.HasColumnType("integer");
b.Property<int>("BatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<bool>("FinishedInitialScan")
.HasColumnType("boolean");
b.Property<int>("InitAssetUpdateTypeDelay")
.HasColumnType("integer");
b.Property<int>("InitBatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<int>("MaxRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("MinRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("TradeRepublicMaxRequestPageSize")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStart")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStop")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Settings");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.AssetEntity", b =>
{
b.Property<string>("Isin")
.HasColumnType("text");
b.Property<string>("AssetType")
.IsRequired()
.HasMaxLength(13)
.HasColumnType("character varying(13)");
b.Property<bool>("HasCfd")
.HasColumnType("boolean");
b.Property<string>("ImageId")
.HasColumnType("text");
b.Property<string>("InstrumentCategory")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdateAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Isin");
b.ToTable("TradeRepublicAssets");
b.HasDiscriminator<string>("AssetType").HasValue("AssetEntity");
b.UseTphMappingStrategy();
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.TagEntity", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("TradeRepublicTags");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.BondEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("BondIssuerName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.HasDiscriminator().HasValue("Bond");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.CryptoEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Subtitle")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("SearchSubtitle")
.HasColumnName("CryptoEntity_SearchSubtitle");
});
b.HasDiscriminator().HasValue("Crypto");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.DerivativeEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.Property<string>("UnderlyingIsin")
.HasColumnType("text");
b.HasDiscriminator().HasValue("Derivative");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.EtfEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.Property<string>("EtfDescription")
.IsRequired()
.HasColumnType("text");
b.Property<string>("MappedEtfIndexName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Subtitle")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("EtfEntity_DerivativeProductCategories");
t.Property("SearchSubtitle")
.HasColumnName("EtfEntity_SearchSubtitle");
t.Property("Subtitle")
.HasColumnName("EtfEntity_Subtitle");
});
b.HasDiscriminator().HasValue("Etf");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.StockEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("StockEntity_DerivativeProductCategories");
});
b.HasDiscriminator().HasValue("Stock");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.SyntheticEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("SyntheticEntity_DerivativeProductCategories");
});
b.HasDiscriminator().HasValue("Synthetic");
});
modelBuilder.Entity("AssetEntityTagEntity", b =>
{
b.HasOne("FinlyticCore.Entities.Assets.AssetEntity", null)
.WithMany()
.HasForeignKey("AssetsIsin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FinlyticCore.Entities.Assets.TagEntity", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -1,293 +0,0 @@
// <auto-generated />
using System;
using FinlyticAssets.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 FinlyticAssets.Migrations
{
[DbContext(typeof(AssetsDbContext))]
[Migration("20260628195842_AddedScannerState")]
partial class AddedScannerState
{
/// <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("AssetEntityTagEntity", b =>
{
b.Property<string>("AssetsIsin")
.HasColumnType("text");
b.Property<string>("TagsId")
.HasColumnType("text");
b.HasKey("AssetsIsin", "TagsId");
b.HasIndex("TagsId");
b.ToTable("AssetEntityTagEntity");
});
modelBuilder.Entity("FinlyticAssets.Entities.Settings", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AssetUpdateTypeDelay")
.HasColumnType("integer");
b.Property<int>("BatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<int>("CurrentScanningPage")
.HasColumnType("integer");
b.Property<string>("CurrentScanningType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("FinishedInitialScan")
.HasColumnType("boolean");
b.Property<int>("InitAssetUpdateTypeDelay")
.HasColumnType("integer");
b.Property<int>("InitBatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<int>("MaxRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("MinRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("TradeRepublicMaxRequestPageSize")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStart")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStop")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Settings");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.AssetEntity", b =>
{
b.Property<string>("Isin")
.HasColumnType("text");
b.Property<string>("AssetType")
.IsRequired()
.HasMaxLength(13)
.HasColumnType("character varying(13)");
b.Property<bool>("HasCfd")
.HasColumnType("boolean");
b.Property<string>("ImageId")
.HasColumnType("text");
b.Property<string>("InstrumentCategory")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdateAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Isin");
b.ToTable("TradeRepublicAssets");
b.HasDiscriminator<string>("AssetType").HasValue("AssetEntity");
b.UseTphMappingStrategy();
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.TagEntity", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("TradeRepublicTags");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.BondEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("BondIssuerName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.HasDiscriminator().HasValue("Bond");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.CryptoEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Subtitle")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("SearchSubtitle")
.HasColumnName("CryptoEntity_SearchSubtitle");
});
b.HasDiscriminator().HasValue("Crypto");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.DerivativeEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.Property<string>("UnderlyingIsin")
.HasColumnType("text");
b.HasDiscriminator().HasValue("Derivative");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.EtfEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.Property<string>("EtfDescription")
.IsRequired()
.HasColumnType("text");
b.Property<string>("MappedEtfIndexName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SearchSubtitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Subtitle")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("EtfEntity_DerivativeProductCategories");
t.Property("SearchSubtitle")
.HasColumnName("EtfEntity_SearchSubtitle");
t.Property("Subtitle")
.HasColumnName("EtfEntity_Subtitle");
});
b.HasDiscriminator().HasValue("Etf");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.StockEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("StockEntity_DerivativeProductCategories");
});
b.HasDiscriminator().HasValue("Stock");
});
modelBuilder.Entity("FinlyticCore.Entities.Assets.SyntheticEntity", b =>
{
b.HasBaseType("FinlyticCore.Entities.Assets.AssetEntity");
b.Property<string>("DerivativeProductCategories")
.IsRequired()
.HasColumnType("text");
b.ToTable("TradeRepublicAssets", t =>
{
t.Property("DerivativeProductCategories")
.HasColumnName("SyntheticEntity_DerivativeProductCategories");
});
b.HasDiscriminator().HasValue("Synthetic");
});
modelBuilder.Entity("AssetEntityTagEntity", b =>
{
b.HasOne("FinlyticCore.Entities.Assets.AssetEntity", null)
.WithMany()
.HasForeignKey("AssetsIsin")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FinlyticCore.Entities.Assets.TagEntity", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -1,41 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FinlyticAssets.Migrations
{
/// <inheritdoc />
public partial class AddedScannerState : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CurrentScanningPage",
table: "Settings",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CurrentScanningType",
table: "Settings",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CurrentScanningPage",
table: "Settings");
migrationBuilder.DropColumn(
name: "CurrentScanningType",
table: "Settings");
}
}
}
@@ -1,107 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FinlyticAssets.Migrations
{
/// <inheritdoc />
public partial class FixIsinKey : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin",
table: "AssetEntityTagEntity");
migrationBuilder.DropPrimaryKey(
name: "PK_TradeRepublicAssets",
table: "TradeRepublicAssets");
migrationBuilder.DropPrimaryKey(
name: "PK_AssetEntityTagEntity",
table: "AssetEntityTagEntity");
migrationBuilder.DropIndex(
name: "IX_AssetEntityTagEntity_TagsId",
table: "AssetEntityTagEntity");
migrationBuilder.AddColumn<string>(
name: "AssetsInstrumentCategory",
table: "AssetEntityTagEntity",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddPrimaryKey(
name: "PK_TradeRepublicAssets",
table: "TradeRepublicAssets",
columns: new[] { "Isin", "InstrumentCategory" });
migrationBuilder.AddPrimaryKey(
name: "PK_AssetEntityTagEntity",
table: "AssetEntityTagEntity",
columns: new[] { "TagsId", "AssetsIsin", "AssetsInstrumentCategory" });
migrationBuilder.CreateIndex(
name: "IX_AssetEntityTagEntity_AssetsIsin_AssetsInstrumentCategory",
table: "AssetEntityTagEntity",
columns: new[] { "AssetsIsin", "AssetsInstrumentCategory" });
migrationBuilder.AddForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin_AssetsI~",
table: "AssetEntityTagEntity",
columns: new[] { "AssetsIsin", "AssetsInstrumentCategory" },
principalTable: "TradeRepublicAssets",
principalColumns: new[] { "Isin", "InstrumentCategory" },
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin_AssetsI~",
table: "AssetEntityTagEntity");
migrationBuilder.DropPrimaryKey(
name: "PK_TradeRepublicAssets",
table: "TradeRepublicAssets");
migrationBuilder.DropPrimaryKey(
name: "PK_AssetEntityTagEntity",
table: "AssetEntityTagEntity");
migrationBuilder.DropIndex(
name: "IX_AssetEntityTagEntity_AssetsIsin_AssetsInstrumentCategory",
table: "AssetEntityTagEntity");
migrationBuilder.DropColumn(
name: "AssetsInstrumentCategory",
table: "AssetEntityTagEntity");
migrationBuilder.AddPrimaryKey(
name: "PK_TradeRepublicAssets",
table: "TradeRepublicAssets",
column: "Isin");
migrationBuilder.AddPrimaryKey(
name: "PK_AssetEntityTagEntity",
table: "AssetEntityTagEntity",
columns: new[] { "AssetsIsin", "TagsId" });
migrationBuilder.CreateIndex(
name: "IX_AssetEntityTagEntity_TagsId",
table: "AssetEntityTagEntity",
column: "TagsId");
migrationBuilder.AddForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin",
table: "AssetEntityTagEntity",
column: "AssetsIsin",
principalTable: "TradeRepublicAssets",
principalColumn: "Isin",
onDelete: ReferentialAction.Cascade);
}
}
}
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using FinlyticAssets.Database;
using Microsoft.EntityFrameworkCore;
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace FinlyticAssets.Migrations
{
[DbContext(typeof(AssetsDbContext))]
[Migration("20260628204647_FixIsinKey")]
partial class FixIsinKey
[Migration("20260801073314_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -72,21 +72,9 @@ namespace FinlyticAssets.Migrations
b.Property<int>("InitBatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<int>("MaxRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("MinRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("TradeRepublicMaxRequestPageSize")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStart")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStop")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Settings");
@@ -122,11 +110,10 @@ namespace FinlyticAssets.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdateAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Isin", "InstrumentCategory");
b.HasIndex("LastUpdatedAt");
b.ToTable("TradeRepublicAssets");
b.HasDiscriminator<string>("AssetType").HasValue("AssetEntity");
@@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
@@ -17,15 +17,13 @@ namespace FinlyticAssets.Migrations
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
FinishedInitialScan = table.Column<bool>(type: "boolean", nullable: false),
MinRandomUpdateDay = table.Column<int>(type: "integer", nullable: false),
MaxRandomUpdateDay = table.Column<int>(type: "integer", nullable: false),
UpdateDayTimeStart = table.Column<int>(type: "integer", nullable: false),
UpdateDayTimeStop = table.Column<int>(type: "integer", nullable: false),
TradeRepublicMaxRequestPageSize = table.Column<int>(type: "integer", nullable: false),
AssetUpdateTypeDelay = table.Column<int>(type: "integer", nullable: false),
InitAssetUpdateTypeDelay = table.Column<int>(type: "integer", nullable: false),
InitBatchAssetUpdateDelay = table.Column<int>(type: "integer", nullable: false),
BatchAssetUpdateDelay = table.Column<int>(type: "integer", nullable: false)
BatchAssetUpdateDelay = table.Column<int>(type: "integer", nullable: false),
CurrentScanningType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
CurrentScanningPage = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
@@ -37,12 +35,11 @@ namespace FinlyticAssets.Migrations
columns: table => new
{
Isin = table.Column<string>(type: "text", nullable: false),
InstrumentCategory = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Type = table.Column<string>(type: "text", nullable: false),
InstrumentCategory = table.Column<string>(type: "text", nullable: false),
HasCfd = table.Column<bool>(type: "boolean", nullable: false),
ImageId = table.Column<string>(type: "text", nullable: true),
UpdateAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastUpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
AssetType = table.Column<string>(type: "character varying(13)", maxLength: 13, nullable: false),
BondIssuerName = table.Column<string>(type: "text", nullable: true),
@@ -61,7 +58,7 @@ namespace FinlyticAssets.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_TradeRepublicAssets", x => x.Isin);
table.PrimaryKey("PK_TradeRepublicAssets", x => new { x.Isin, x.InstrumentCategory });
});
migrationBuilder.CreateTable(
@@ -81,17 +78,18 @@ namespace FinlyticAssets.Migrations
name: "AssetEntityTagEntity",
columns: table => new
{
TagsId = table.Column<string>(type: "text", nullable: false),
AssetsIsin = table.Column<string>(type: "text", nullable: false),
TagsId = table.Column<string>(type: "text", nullable: false)
AssetsInstrumentCategory = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AssetEntityTagEntity", x => new { x.AssetsIsin, x.TagsId });
table.PrimaryKey("PK_AssetEntityTagEntity", x => new { x.TagsId, x.AssetsIsin, x.AssetsInstrumentCategory });
table.ForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin",
column: x => x.AssetsIsin,
name: "FK_AssetEntityTagEntity_TradeRepublicAssets_AssetsIsin_AssetsI~",
columns: x => new { x.AssetsIsin, x.AssetsInstrumentCategory },
principalTable: "TradeRepublicAssets",
principalColumn: "Isin",
principalColumns: new[] { "Isin", "InstrumentCategory" },
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AssetEntityTagEntity_TradeRepublicTags_TagsId",
@@ -102,9 +100,14 @@ namespace FinlyticAssets.Migrations
});
migrationBuilder.CreateIndex(
name: "IX_AssetEntityTagEntity_TagsId",
name: "IX_AssetEntityTagEntity_AssetsIsin_AssetsInstrumentCategory",
table: "AssetEntityTagEntity",
column: "TagsId");
columns: new[] { "AssetsIsin", "AssetsInstrumentCategory" });
migrationBuilder.CreateIndex(
name: "IX_TradeRepublicAssets_LastUpdatedAt",
table: "TradeRepublicAssets",
column: "LastUpdatedAt");
}
/// <inheritdoc />
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using FinlyticAssets.Database;
using Microsoft.EntityFrameworkCore;
@@ -69,21 +69,9 @@ namespace FinlyticAssets.Migrations
b.Property<int>("InitBatchAssetUpdateDelay")
.HasColumnType("integer");
b.Property<int>("MaxRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("MinRandomUpdateDay")
.HasColumnType("integer");
b.Property<int>("TradeRepublicMaxRequestPageSize")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStart")
.HasColumnType("integer");
b.Property<int>("UpdateDayTimeStop")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Settings");
@@ -119,11 +107,10 @@ namespace FinlyticAssets.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdateAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Isin", "InstrumentCategory");
b.HasIndex("LastUpdatedAt");
b.ToTable("TradeRepublicAssets");
b.HasDiscriminator<string>("AssetType").HasValue("AssetEntity");