feat(trades): align TradeProposal and TradeAcceptance DTOs, update lifecycle and migrations
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FinlyticCore.Entities.Settings;
|
||||
using FinlyticTrades.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -7,6 +8,7 @@ public class TradesDbContext : DbContext
|
||||
{
|
||||
public TradesDbContext(DbContextOptions<TradesDbContext> options) : base(options) { }
|
||||
|
||||
public DbSet<SettingEntity> DynamicSettings => Set<SettingEntity>();
|
||||
public DbSet<TradeEntity> Trades => Set<TradeEntity>();
|
||||
public DbSet<TradeHourlyUpdateEntity> TradeHourlyUpdates => Set<TradeHourlyUpdateEntity>();
|
||||
public DbSet<TradesSettingsEntity> Settings => Set<TradesSettingsEntity>();
|
||||
@@ -15,6 +17,12 @@ public class TradesDbContext : DbContext
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<SettingEntity>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id);
|
||||
entity.HasIndex(e => e.Key);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<TradeEntity>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.TradeId).IsUnique();
|
||||
|
||||
Reference in New Issue
Block a user