- .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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace NadekoBot.Migrations
{
public partial class logignoreuserrolechannel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
table: "IgnoredLogChannels");
migrationBuilder.RenameColumn(
name: "ChannelId",
table: "IgnoredLogChannels",
newName: "LogItemId");
migrationBuilder.AddColumn<int>(
name: "ItemType",
table: "IgnoredLogChannels",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_IgnoredLogChannels_LogItemId_ItemType",
table: "IgnoredLogChannels",
columns: new[] { "LogItemId", "ItemType" },
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
table: "IgnoredLogChannels",
column: "LogSettingId",
principalTable: "LogSettings",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
table: "IgnoredLogChannels");
migrationBuilder.DropIndex(
name: "IX_IgnoredLogChannels_LogItemId_ItemType",
table: "IgnoredLogChannels");
migrationBuilder.DropColumn(
name: "ItemType",
table: "IgnoredLogChannels");
migrationBuilder.RenameColumn(
name: "LogItemId",
table: "IgnoredLogChannels",
newName: "ChannelId");
migrationBuilder.AddForeignKey(
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
table: "IgnoredLogChannels",
column: "LogSettingId",
principalTable: "LogSettings",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -187,29 +187,6 @@ namespace NadekoBot.Migrations
b.ToTable("FollowedStream");
});
modelBuilder.Entity("NadekoBot.Services.Database.ImageOnlyChannel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("ChannelId")
.HasColumnType("INTEGER");
b.Property<DateTime?>("DateAdded")
.HasColumnType("TEXT");
b.Property<ulong>("GuildId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ChannelId")
.IsUnique();
b.ToTable("ImageOnlyChannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiAltSetting", b =>
{
b.Property<int>("Id")
@@ -870,18 +847,21 @@ namespace NadekoBot.Migrations
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogChannel", b =>
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("ChannelId")
.HasColumnType("INTEGER");
b.Property<DateTime?>("DateAdded")
.HasColumnType("TEXT");
b.Property<int>("ItemType")
.HasColumnType("INTEGER");
b.Property<ulong>("LogItemId")
.HasColumnType("INTEGER");
b.Property<int?>("LogSettingId")
.HasColumnType("INTEGER");
@@ -889,6 +869,9 @@ namespace NadekoBot.Migrations
b.HasIndex("LogSettingId");
b.HasIndex("LogItemId", "ItemType")
.IsUnique();
b.ToTable("IgnoredLogChannels");
});
@@ -914,6 +897,29 @@ namespace NadekoBot.Migrations
b.ToTable("IgnoredVoicePresenceCHannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ImageOnlyChannel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong>("ChannelId")
.HasColumnType("INTEGER");
b.Property<DateTime?>("DateAdded")
.HasColumnType("TEXT");
b.Property<ulong>("GuildId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ChannelId")
.IsUnique();
b.ToTable("ImageOnlyChannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.LogSetting", b =>
{
b.Property<int>("Id")
@@ -2269,11 +2275,12 @@ namespace NadekoBot.Migrations
b.Navigation("GuildConfig");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogChannel", b =>
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogItem", b =>
{
b.HasOne("NadekoBot.Services.Database.Models.LogSetting", "LogSetting")
.WithMany("IgnoredChannels")
.HasForeignKey("LogSettingId");
.WithMany("LogIgnores")
.HasForeignKey("LogSettingId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("LogSetting");
});
@@ -2598,9 +2605,9 @@ namespace NadekoBot.Migrations
modelBuilder.Entity("NadekoBot.Services.Database.Models.LogSetting", b =>
{
b.Navigation("IgnoredChannels");
b.Navigation("IgnoredVoicePresenceChannelIds");
b.Navigation("LogIgnores");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.MusicPlaylist", b =>