feat(technical,sentiment,news): add pending migrations and DbContext updates
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FinlyticCore.Entities.Settings;
|
||||
using FinlyticTechnicalAnalysis.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -9,6 +10,7 @@ public class TechnicalAnalysisDbContext : DbContext
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<SettingEntity> DynamicSettings => Set<SettingEntity>();
|
||||
public DbSet<MarketCandleEntity> MarketCandles => Set<MarketCandleEntity>();
|
||||
public DbSet<MacroDataEntity> MacroData => Set<MacroDataEntity>();
|
||||
public DbSet<CachedAnalysisEntity> CachedAnalyses => Set<CachedAnalysisEntity>();
|
||||
@@ -18,6 +20,12 @@ public class TechnicalAnalysisDbContext : DbContext
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<SettingEntity>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id);
|
||||
entity.HasIndex(e => e.Key);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<MarketCandleEntity>()
|
||||
.HasIndex(c => new { c.Symbol, c.Interval, c.Timestamp })
|
||||
.IsUnique();
|
||||
|
||||
Reference in New Issue
Block a user