Enhance UI, add AI integration, improve logging and database stats
This commit is contained in:
@@ -7,6 +7,7 @@ public class AppDbContext : DbContext
|
||||
{
|
||||
public DbSet<Trader> Traders => Set<Trader>();
|
||||
public DbSet<Trade> Trades => Set<Trade>();
|
||||
public DbSet<Event> Events => Set<Event>();
|
||||
public DbSet<Market> Markets => Set<Market>();
|
||||
public DbSet<MarketOutcome> MarketOutcomes => Set<MarketOutcome>();
|
||||
public DbSet<TraderScore> TraderScores => Set<TraderScore>();
|
||||
@@ -66,19 +67,34 @@ public class AppDbContext : DbContext
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
// Event
|
||||
mb.Entity<Event>(e =>
|
||||
{
|
||||
e.HasKey(ev => ev.Id);
|
||||
e.HasIndex(ev => new { ev.Platform, ev.PlatformEventId }).IsUnique();
|
||||
e.Property(ev => ev.Slug).HasMaxLength(512);
|
||||
e.Property(ev => ev.Title).HasMaxLength(1024);
|
||||
e.Property(ev => ev.Description).HasMaxLength(4096);
|
||||
e.Property(ev => ev.ImageUrl).HasMaxLength(1024);
|
||||
e.Property(ev => ev.Tags).HasMaxLength(1024);
|
||||
e.HasMany(ev => ev.Markets).WithOne(m => m.Event).HasForeignKey(m => m.EventId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
// Market
|
||||
mb.Entity<Market>(e =>
|
||||
{
|
||||
e.HasKey(m => m.Id);
|
||||
e.HasIndex(m => new { m.Platform, m.PlatformMarketId }).IsUnique();
|
||||
e.Property(m => m.PlatformMarketId).HasMaxLength(256);
|
||||
e.Property(m => m.ConditionId).HasMaxLength(256);
|
||||
e.Property(m => m.QuestionId).HasMaxLength(256);
|
||||
e.Property(m => m.MarketSlug).HasMaxLength(512);
|
||||
e.Property(m => m.EventSlug).HasMaxLength(512);
|
||||
e.Property(m => m.Question).HasMaxLength(1024);
|
||||
e.Property(m => m.Description).HasMaxLength(4096);
|
||||
e.Property(m => m.ImageUrl).HasMaxLength(1024);
|
||||
e.Property(m => m.Category).HasMaxLength(128);
|
||||
e.Property(m => m.Volume).HasPrecision(18, 4);
|
||||
e.Property(m => m.Volume24h).HasPrecision(18, 4);
|
||||
e.Property(m => m.Liquidity).HasPrecision(18, 4);
|
||||
e.HasMany(m => m.Outcomes).WithOne(o => o.Market).HasForeignKey(o => o.MarketId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
Reference in New Issue
Block a user