Role ban improvements (#6855)

This commit is contained in:
ShadowCommander
2022-02-21 21:00:55 -08:00
committed by GitHub
parent 8ccdff4416
commit 4a68718050
5 changed files with 96 additions and 13 deletions

View File

@@ -112,6 +112,22 @@ namespace Content.Server.Database
modelBuilder.Entity<ServerBan>()
.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR user_id IS NOT NULL OR hwid IS NOT NULL");
modelBuilder.Entity<ServerRoleBan>()
.HasIndex(p => p.UserId);
modelBuilder.Entity<ServerRoleBan>()
.HasIndex(p => p.Address);
modelBuilder.Entity<ServerRoleBan>()
.HasIndex(p => p.UserId);
modelBuilder.Entity<ServerRoleUnban>()
.HasIndex(p => p.BanId)
.IsUnique();
modelBuilder.Entity<ServerRoleBan>()
.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR user_id IS NOT NULL OR hwid IS NOT NULL");
modelBuilder.Entity<Player>()
.HasIndex(p => p.UserId)
.IsUnique();