2018-11-27 19:31:48 -05:00
|
|
|
|
using IW4MAdmin.Plugins.Stats.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2018-04-08 17:50:58 -04:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
|
|
|
|
|
|
|
|
|
namespace Stats.Models
|
|
|
|
|
{
|
|
|
|
|
public class ModelConfiguration : IModelConfiguration
|
|
|
|
|
{
|
|
|
|
|
public void Configure(ModelBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Entity<EFClientStatistics>()
|
|
|
|
|
.HasKey(cs => new { cs.ClientId, cs.ServerId });
|
2018-04-09 15:17:10 -04:00
|
|
|
|
|
|
|
|
|
// fix linking from SQLCe
|
|
|
|
|
builder.Entity<EFHitLocationCount>()
|
2019-10-07 11:26:07 -04:00
|
|
|
|
.Property(c => c.EFClientStatisticsClientId)
|
|
|
|
|
.HasColumnName("EFClientStatisticsClientId");
|
2018-04-09 15:17:10 -04:00
|
|
|
|
|
|
|
|
|
builder.Entity<EFHitLocationCount>()
|
2019-10-07 11:26:07 -04:00
|
|
|
|
.Property(c => c.EFClientStatisticsServerId)
|
|
|
|
|
.HasColumnName("EFClientStatisticsServerId");
|
2018-04-09 15:17:10 -04:00
|
|
|
|
|
2018-09-11 15:28:37 -04:00
|
|
|
|
builder.Entity<EFRating>()
|
2019-07-24 20:15:07 -04:00
|
|
|
|
.HasIndex(p => new { p.Performance, p.Ranking, p.When });
|
2018-09-11 15:28:37 -04:00
|
|
|
|
|
2018-09-16 16:34:16 -04:00
|
|
|
|
builder.Entity<EFClientMessage>()
|
|
|
|
|
.HasIndex(p => p.TimeSent);
|
|
|
|
|
|
2018-04-09 15:17:10 -04:00
|
|
|
|
// 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");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|