feat(sentiment): add persistent sentiment entities, summaries, SentimentDbService and MQTT RPC refactoring
This commit is contained in:
-63
@@ -1,63 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticSentiment.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 FinlyticSentiment.Migrations
|
||||
{
|
||||
[DbContext(typeof(SentimentDbContext))]
|
||||
[Migration("20260801090401_InitialSentimentSettings")]
|
||||
partial class InitialSentimentSettings
|
||||
{
|
||||
/// <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("FinlyticSentiment.Entities.SentimentSettingsEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("EnglishWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("GermanWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<int>("MaxBatchSize")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<double>("MinConfidenceScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("SweepIntervalMinutes")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("sentiment_settings", (string)null);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticSentiment.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialSentimentSettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "sentiment_settings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
MinConfidenceScore = table.Column<double>(type: "double precision", nullable: false),
|
||||
MaxBatchSize = table.Column<int>(type: "integer", nullable: false),
|
||||
SweepIntervalMinutes = table.Column<int>(type: "integer", nullable: false),
|
||||
GermanWebhookUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
|
||||
EnglishWebhookUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_sentiment_settings", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "sentiment_settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticSentiment.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 FinlyticSentiment.Migrations
|
||||
{
|
||||
[DbContext(typeof(SentimentDbContext))]
|
||||
[Migration("20260813202634_CheckPendingSentiment")]
|
||||
partial class CheckPendingSentiment
|
||||
{
|
||||
/// <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("FinlyticSentiment.Entities.SentimentSettingsEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("EnglishWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("GermanWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<int>("MaxBatchSize")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<double>("MinConfidenceScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("SweepIntervalMinutes")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("sentiment_settings", (string)null);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticSentiment.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CheckPendingSentiment : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticSentiment.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 FinlyticSentiment.Migrations
|
||||
{
|
||||
[DbContext(typeof(SentimentDbContext))]
|
||||
[Migration("20260815184006_AddDynamicSettings")]
|
||||
partial class AddDynamicSettings
|
||||
{
|
||||
/// <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")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.SentimentSettingsEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("EnglishWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("GermanWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<int>("MaxBatchSize")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<double>("MinConfidenceScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("SweepIntervalMinutes")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("sentiment_settings", (string)null);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticSentiment.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddDynamicSettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
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.CreateIndex(
|
||||
name: "IX_DynamicSettings_Key",
|
||||
table: "DynamicSettings",
|
||||
column: "Key",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DynamicSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FinlyticSentiment.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 FinlyticSentiment.Migrations
|
||||
{
|
||||
[DbContext(typeof(SentimentDbContext))]
|
||||
[Migration("20260818202351_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")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.ArticleSentimentEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("AnalyzedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("ArticleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<double>("CompoundScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("Confidence")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("Impact")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<string>("Isin")
|
||||
.IsRequired()
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.Property<string>("KeyHighlight")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<double>("NegativeProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("NeutralProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("PositiveProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<DateTime>("PublishedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AnalyzedAtUtc");
|
||||
|
||||
b.HasIndex("Sector");
|
||||
|
||||
b.HasIndex("ArticleId", "Isin")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Isin", "PublishedAtUtc");
|
||||
|
||||
b.ToTable("article_sentiments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.CompanySentimentSummaryEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.Property<double>("AverageConfidence")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("AverageScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("CurrentLabel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("LatestKeyHighlight")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<int>("NegativeCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("NeutralCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("PositiveCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.Property<int>("TotalAnalysesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Trend")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<long>("Version")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("WeightedScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("LastUpdatedUtc");
|
||||
|
||||
b.HasIndex("Sector");
|
||||
|
||||
b.HasIndex("WeightedScore");
|
||||
|
||||
b.ToTable("company_sentiment_summaries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.SectorSentimentSummaryEntity", b =>
|
||||
{
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.Property<double>("AverageScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("CurrentLabel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("TotalArticlesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TotalCompaniesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Sector");
|
||||
|
||||
b.HasIndex("LastUpdatedUtc");
|
||||
|
||||
b.ToTable("sector_sentiment_summaries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FinlyticSentiment.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "article_sentiments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ArticleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Isin = table.Column<string>(type: "character varying(12)", maxLength: 12, nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||
Sector = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||
Label = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
||||
CompoundScore = table.Column<double>(type: "double precision", nullable: false),
|
||||
Confidence = table.Column<double>(type: "double precision", nullable: false),
|
||||
Impact = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
||||
PositiveProbability = table.Column<double>(type: "double precision", nullable: false),
|
||||
NegativeProbability = table.Column<double>(type: "double precision", nullable: false),
|
||||
NeutralProbability = table.Column<double>(type: "double precision", nullable: false),
|
||||
KeyHighlight = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||
PublishedAtUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
AnalyzedAtUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_article_sentiments", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "company_sentiment_summaries",
|
||||
columns: table => new
|
||||
{
|
||||
Isin = table.Column<string>(type: "character varying(12)", maxLength: 12, nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||
Sector = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||
CurrentLabel = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
||||
AverageScore = table.Column<double>(type: "double precision", nullable: false),
|
||||
WeightedScore = table.Column<double>(type: "double precision", nullable: false),
|
||||
AverageConfidence = table.Column<double>(type: "double precision", nullable: false),
|
||||
TotalAnalysesCount = table.Column<int>(type: "integer", nullable: false),
|
||||
PositiveCount = table.Column<int>(type: "integer", nullable: false),
|
||||
NegativeCount = table.Column<int>(type: "integer", nullable: false),
|
||||
NeutralCount = table.Column<int>(type: "integer", nullable: false),
|
||||
LatestKeyHighlight = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||
Trend = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
|
||||
LastUpdatedUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Version = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_company_sentiment_summaries", 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: "sector_sentiment_summaries",
|
||||
columns: table => new
|
||||
{
|
||||
Sector = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||
CurrentLabel = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
||||
AverageScore = table.Column<double>(type: "double precision", nullable: false),
|
||||
TotalArticlesCount = table.Column<int>(type: "integer", nullable: false),
|
||||
TotalCompaniesCount = table.Column<int>(type: "integer", nullable: false),
|
||||
LastUpdatedUtc = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_sector_sentiment_summaries", x => x.Sector);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_article_sentiments_AnalyzedAtUtc",
|
||||
table: "article_sentiments",
|
||||
column: "AnalyzedAtUtc");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_article_sentiments_ArticleId_Isin",
|
||||
table: "article_sentiments",
|
||||
columns: new[] { "ArticleId", "Isin" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_article_sentiments_Isin_PublishedAtUtc",
|
||||
table: "article_sentiments",
|
||||
columns: new[] { "Isin", "PublishedAtUtc" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_article_sentiments_Sector",
|
||||
table: "article_sentiments",
|
||||
column: "Sector");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_company_sentiment_summaries_LastUpdatedUtc",
|
||||
table: "company_sentiment_summaries",
|
||||
column: "LastUpdatedUtc");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_company_sentiment_summaries_Sector",
|
||||
table: "company_sentiment_summaries",
|
||||
column: "Sector");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_company_sentiment_summaries_WeightedScore",
|
||||
table: "company_sentiment_summaries",
|
||||
column: "WeightedScore");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DynamicSettings_Key",
|
||||
table: "DynamicSettings",
|
||||
column: "Key",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_sector_sentiment_summaries_LastUpdatedUtc",
|
||||
table: "sector_sentiment_summaries",
|
||||
column: "LastUpdatedUtc");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "article_sentiments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "company_sentiment_summaries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DynamicSettings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "sector_sentiment_summaries");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,37 +53,172 @@ namespace FinlyticSentiment.Migrations
|
||||
b.ToTable("DynamicSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.SentimentSettingsEntity", b =>
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.ArticleSentimentEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("EnglishWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
b.Property<DateTime>("AnalyzedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("GermanWebhookUrl")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
b.Property<Guid>("ArticleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("MaxBatchSize")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<double>("MinConfidenceScore")
|
||||
b.Property<double>("CompoundScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<int>("SweepIntervalMinutes")
|
||||
.HasColumnType("integer");
|
||||
b.Property<double>("Confidence")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
b.Property<string>("Impact")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<string>("Isin")
|
||||
.IsRequired()
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.Property<string>("KeyHighlight")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<double>("NegativeProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("NeutralProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("PositiveProbability")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<DateTime>("PublishedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("sentiment_settings", (string)null);
|
||||
b.HasIndex("AnalyzedAtUtc");
|
||||
|
||||
b.HasIndex("Sector");
|
||||
|
||||
b.HasIndex("ArticleId", "Isin")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Isin", "PublishedAtUtc");
|
||||
|
||||
b.ToTable("article_sentiments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.CompanySentimentSummaryEntity", b =>
|
||||
{
|
||||
b.Property<string>("Isin")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("character varying(12)");
|
||||
|
||||
b.Property<double>("AverageConfidence")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<double>("AverageScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("CurrentLabel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("LatestKeyHighlight")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<int>("NegativeCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("NeutralCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("PositiveCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.Property<int>("TotalAnalysesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Trend")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<long>("Version")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("WeightedScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.HasKey("Isin");
|
||||
|
||||
b.HasIndex("LastUpdatedUtc");
|
||||
|
||||
b.HasIndex("Sector");
|
||||
|
||||
b.HasIndex("WeightedScore");
|
||||
|
||||
b.ToTable("company_sentiment_summaries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FinlyticSentiment.Entities.SectorSentimentSummaryEntity", b =>
|
||||
{
|
||||
b.Property<string>("Sector")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("character varying(128)");
|
||||
|
||||
b.Property<double>("AverageScore")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.Property<string>("CurrentLabel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("TotalArticlesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TotalCompaniesCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Sector");
|
||||
|
||||
b.HasIndex("LastUpdatedUtc");
|
||||
|
||||
b.ToTable("sector_sentiment_summaries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user