- .logignore now supports targeting channels and users

- .logignore now lists all ignored channels and users when no parameter is provided
- Renamed and cleaned up some log-related fields
This commit is contained in:
Kwoth
2021-09-21 22:39:06 +02:00
parent 611817f78a
commit c9e89e1911
13 changed files with 2882 additions and 120 deletions

View File

@@ -42,8 +42,8 @@ namespace NadekoBot.Services.Database
//logging
public DbSet<LogSetting> LogSettings { get; set; }
public DbSet<IgnoredLogChannel> IgnoredLogChannels { get; set; }
public DbSet<IgnoredVoicePresenceChannel> IgnoredVoicePresenceCHannels { get; set; }
public DbSet<IgnoredLogItem> IgnoredLogChannels { get; set; }
public DbSet<RotatingPlayingStatus> RotatingStatus { get; set; }
public DbSet<BlacklistEntry> Blacklist { get; set; }
@@ -342,6 +342,15 @@ namespace NadekoBot.Services.Database
modelBuilder.Entity<LogSetting>(ls => ls
.HasIndex(x => x.GuildId)
.IsUnique());
modelBuilder.Entity<LogSetting>(ls => ls
.HasMany(x => x.LogIgnores)
.WithOne(x => x.LogSetting)
.OnDelete(DeleteBehavior.Cascade));
modelBuilder.Entity<IgnoredLogItem>(ili => ili
.HasIndex(x => new { ItemId = x.LogItemId, x.ItemType })
.IsUnique());
#endregion