mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
Show time passed since ban instead of "forever"
reworked event api to include all events (sans unknown)
This commit is contained in:
@ -17,6 +17,7 @@ namespace SharedLibraryCore.Database
|
||||
public DbSet<EFAliasLink> AliasLinks { get; set; }
|
||||
public DbSet<EFPenalty> Penalties { get; set; }
|
||||
public DbSet<EFMeta> EFMeta { get; set; }
|
||||
public DbSet<EFChangeHistory> EFChangeHistory { get; set; }
|
||||
|
||||
private static string _ConnectionString;
|
||||
|
||||
@ -79,6 +80,11 @@ namespace SharedLibraryCore.Database
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<EFAlias>(ent =>
|
||||
{
|
||||
ent.HasIndex(a => a.IPAddress);
|
||||
});
|
||||
|
||||
// force full name for database conversion
|
||||
modelBuilder.Entity<EFClient>().ToTable("EFClients");
|
||||
modelBuilder.Entity<EFAlias>().ToTable("EFAlias");
|
||||
|
27
SharedLibraryCore/Database/Models/EFChangeHistory.cs
Normal file
27
SharedLibraryCore/Database/Models/EFChangeHistory.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedLibraryCore.Database.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// This class models the change to different entities
|
||||
/// </summary>
|
||||
public class EFChangeHistory : SharedEntity
|
||||
{
|
||||
public enum ChangeType
|
||||
{
|
||||
Permission
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int ChangeHistoryId { get; set; }
|
||||
public int OriginEntityId { get; set; }
|
||||
public int TargetEntityId { get; set; }
|
||||
public ChangeType TypeOfChange { get; set; }
|
||||
public DateTime TimeChanged { get; set; } = DateTime.UtcNow;
|
||||
[MaxLength(128)]
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user