Log ban hits in DB. (#6337)

This commit is contained in:
Pieter-Jan Briers
2022-01-28 19:10:44 +01:00
committed by GitHub
parent a3aabf59ad
commit b75f005bb4
13 changed files with 2150 additions and 39 deletions

View File

@@ -279,6 +279,10 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("TEXT")
.HasColumnName("address");
b.Property<byte?>("Denied")
.HasColumnType("INTEGER")
.HasColumnName("denied");
b.Property<byte[]>("HWId")
.HasColumnType("BLOB")
.HasColumnName("hwid");
@@ -572,6 +576,33 @@ namespace Content.Server.Database.Migrations.Sqlite
b.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR user_id IS NOT NULL OR hwid IS NOT NULL");
});
modelBuilder.Entity("Content.Server.Database.ServerBanHit", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasColumnName("server_ban_hit_id");
b.Property<int>("BanId")
.HasColumnType("INTEGER")
.HasColumnName("ban_id");
b.Property<int>("ConnectionId")
.HasColumnType("INTEGER")
.HasColumnName("connection_id");
b.HasKey("Id")
.HasName("PK_server_ban_hit");
b.HasIndex("BanId")
.HasDatabaseName("IX_server_ban_hit_ban_id");
b.HasIndex("ConnectionId")
.HasDatabaseName("IX_server_ban_hit_connection_id");
b.ToTable("server_ban_hit", (string)null);
});
modelBuilder.Entity("Content.Server.Database.ServerUnban", b =>
{
b.Property<int>("Id")
@@ -745,6 +776,27 @@ namespace Content.Server.Database.Migrations.Sqlite
b.Navigation("Preference");
});
modelBuilder.Entity("Content.Server.Database.ServerBanHit", b =>
{
b.HasOne("Content.Server.Database.ServerBan", "Ban")
.WithMany("BanHits")
.HasForeignKey("BanId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_server_ban_hit_server_ban_ban_id");
b.HasOne("Content.Server.Database.ConnectionLog", "Connection")
.WithMany("BanHits")
.HasForeignKey("ConnectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_server_ban_hit_connection_log_connection_id");
b.Navigation("Ban");
b.Navigation("Connection");
});
modelBuilder.Entity("Content.Server.Database.ServerUnban", b =>
{
b.HasOne("Content.Server.Database.ServerBan", "Ban")
@@ -793,6 +845,11 @@ namespace Content.Server.Database.Migrations.Sqlite
b.Navigation("Flags");
});
modelBuilder.Entity("Content.Server.Database.ConnectionLog", b =>
{
b.Navigation("BanHits");
});
modelBuilder.Entity("Content.Server.Database.Player", b =>
{
b.Navigation("AdminLogs");
@@ -817,6 +874,8 @@ namespace Content.Server.Database.Migrations.Sqlite
modelBuilder.Entity("Content.Server.Database.ServerBan", b =>
{
b.Navigation("BanHits");
b.Navigation("Unban");
});
#pragma warning restore 612, 618