migrate welcome plugin to .NET Core 2.0
more fixes to stats database for migration last connection set when client connects and disconnects update GeoIP datatbase
This commit is contained in:
@ -12,11 +12,9 @@ namespace IW4MAdmin.Plugins.Stats.Models
|
||||
{
|
||||
public class EFClientStatistics : SharedEntity
|
||||
{
|
||||
//[Key, Column(Order = 0)]
|
||||
public int ClientId { get; set; }
|
||||
[ForeignKey("ClientId")]
|
||||
public virtual EFClient Client { get; set; }
|
||||
//[Key, Column(Order = 1)]
|
||||
public int ServerId { get; set; }
|
||||
[ForeignKey("ServerId")]
|
||||
public virtual EFServer Server { get; set; }
|
||||
|
@ -1,5 +1,6 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace IW4MAdmin.Plugins.Stats.Models
|
||||
{
|
||||
@ -13,5 +14,12 @@ namespace IW4MAdmin.Plugins.Stats.Models
|
||||
public int HitCount { get; set; }
|
||||
[Required]
|
||||
public float HitOffsetAverage { get; set; }
|
||||
public int ClientId { get; set; }
|
||||
[ForeignKey("ClientId"), Column(Order = 0 )]
|
||||
public EFClient Client { get; set; }
|
||||
public int ServerId { get; set; }
|
||||
[ForeignKey("ServerId"), Column(Order = 1)]
|
||||
public EFServer Server { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,23 @@ namespace Stats.Models
|
||||
{
|
||||
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");
|
||||
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user