IW4M-Admin/Plugins/Stats/Models/ModelConfiguration.cs
RaidMax 4a46abc46d add index to time sent in EFCLientMessage, so we can retrieve faster in context view
set the maximum height of the
add link to profile on client chat
move change history into a seperate service
move around AC penalty processing
2018-09-16 15:34:16 -05:00

46 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore;
using SharedLibraryCore.Interfaces;
using IW4MAdmin.Plugins.Stats.Models;
namespace Stats.Models
{
public class ModelConfiguration : IModelConfiguration
{
public void Configure(ModelBuilder builder)
{
builder.Entity<EFClientStatistics>()
.HasKey(cs => new { cs.ClientId, cs.ServerId });
// fix linking from SQLCe
builder.Entity<EFHitLocationCount>()
.Property(c => c.ClientId)
.HasColumnName("EFClientStatistics_ClientId");
builder.Entity<EFHitLocationCount>()
.Property(c => c.ServerId)
.HasColumnName("EFClientStatistics_ServerId");
builder.Entity<EFRating>()
.HasIndex(p => p.Performance);
builder.Entity<EFRating>()
.HasIndex(p => p.Ranking);
builder.Entity<EFRating>()
.HasIndex(p => p.When);
builder.Entity<EFClientMessage>()
.HasIndex(p => p.TimeSent);
// force pluralization
builder.Entity<EFClientKill>().ToTable("EFClientKills");
builder.Entity<EFClientMessage>().ToTable("EFClientMessages");
builder.Entity<EFClientStatistics>().ToTable("EFClientStatistics");
builder.Entity<EFHitLocationCount>().ToTable("EFHitLocationCounts");
builder.Entity<EFServer>().ToTable("EFServers");
builder.Entity<EFServerStatistics>().ToTable("EFServerStatistics");
}
}
}