Netharria_Grimoire/Grimoire.Core/Migrations/20231104153925_Fix-Delete-Behavior-And-Add-Ignored-Tables.Designer.cs
// <auto-generated />
using System;
using Grimoire.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Grimoire.Core.Migrations
{
    [DbContext(typeof(GrimoireDbContext))]
    [Migration("20231104153925_Fix-Delete-Behavior-And-Add-Ignored-Tables")]
    partial class FixDeleteBehaviorAndAddIgnoredTables
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.11")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Grimoire.Domain.Attachment", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasMaxLength(2048)
                        .HasColumnType("character varying(2048)");

                    b.Property<decimal>("MessageId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("MessageId");

                    b.ToTable("Attachments");
                });

            modelBuilder.Entity("Grimoire.Domain.Avatar", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasMaxLength(2048)
                        .HasColumnType("character varying(2048)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("Timestamp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("UserId", "GuildId", "Timestamp")
                        .IsDescending(false, false, true);

                    b.ToTable("Avatars");
                });

            modelBuilder.Entity("Grimoire.Domain.Channel", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<bool>("IsXpIgnored")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.HasKey("Id");

                    b.HasIndex("GuildId");

                    b.HasIndex("IsXpIgnored")
                        .HasFilter("\"IsXpIgnored\" = TRUE");

                    b.ToTable("Channels");
                });

            modelBuilder.Entity("Grimoire.Domain.Guild", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ModChannelLog")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("ModChannelLog");

                    b.ToTable("Guilds");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildLevelSettings", b =>
                {
                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<int>("Amount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(5);

                    b.Property<int>("Base")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(15);

                    b.Property<decimal?>("LevelChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<int>("Modifier")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(50);

                    b.Property<bool>("ModuleEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<TimeSpan>("TextTime")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("interval")
                        .HasDefaultValue(new TimeSpan(0, 0, 3, 0, 0));

                    b.HasKey("GuildId");

                    b.HasIndex("LevelChannelLogId");

                    b.ToTable("GuildLevelSettings");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildMessageLogSettings", b =>
                {
                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("BulkDeleteChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("DeleteChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("EditChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<bool>("ModuleEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.HasKey("GuildId");

                    b.HasIndex("BulkDeleteChannelLogId")
                        .IsUnique();

                    b.HasIndex("DeleteChannelLogId")
                        .IsUnique();

                    b.HasIndex("EditChannelLogId")
                        .IsUnique();

                    b.ToTable("GuildMessageLogSettings");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildModerationSettings", b =>
                {
                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<TimeSpan>("AutoPardonAfter")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("interval")
                        .HasDefaultValue(new TimeSpan(10950, 0, 0, 0, 0));

                    b.Property<bool>("ModuleEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<decimal?>("MuteRole")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("PublicBanLog")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("GuildId");

                    b.HasIndex("MuteRole")
                        .IsUnique();

                    b.ToTable("GuildModerationSettings");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildUserLogSettings", b =>
                {
                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("AvatarChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("JoinChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("LeaveChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<bool>("ModuleEnabled")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<decimal?>("NicknameChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("UsernameChannelLogId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("GuildId");

                    b.HasIndex("AvatarChannelLogId")
                        .IsUnique();

                    b.HasIndex("JoinChannelLogId")
                        .IsUnique();

                    b.HasIndex("LeaveChannelLogId")
                        .IsUnique();

                    b.HasIndex("NicknameChannelLogId")
                        .IsUnique();

                    b.HasIndex("UsernameChannelLogId")
                        .IsUnique();

                    b.ToTable("GuildUserLogSettings");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredChannel", b =>
                {
                    b.Property<decimal>("ChannelId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("ChannelId");

                    b.HasIndex("GuildId");

                    b.ToTable("IgnoredChannels");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredMember", b =>
                {
                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("UserId");

                    b.HasIndex("GuildId");

                    b.HasIndex("UserId", "GuildId")
                        .IsUnique();

                    b.ToTable("IgnoredMembers");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredRole", b =>
                {
                    b.Property<decimal>("RoleId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("RoleId");

                    b.HasIndex("GuildId");

                    b.ToTable("IgnoredRoles");
                });

            modelBuilder.Entity("Grimoire.Domain.Lock", b =>
                {
                    b.Property<decimal>("ChannelId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ModeratorId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<long>("PreviouslyAllowed")
                        .HasColumnType("bigint");

                    b.Property<long>("PreviouslyDenied")
                        .HasColumnType("bigint");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.HasKey("ChannelId");

                    b.HasIndex("EndTime");

                    b.HasIndex("GuildId");

                    b.HasIndex("ModeratorId", "GuildId");

                    b.ToTable("Locks");
                });

            modelBuilder.Entity("Grimoire.Domain.Member", b =>
                {
                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<bool>("IsXpIgnored")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.HasKey("UserId", "GuildId");

                    b.HasIndex("IsXpIgnored")
                        .HasFilter("\"IsXpIgnored\" = TRUE");

                    b.ToTable("Members");
                });

            modelBuilder.Entity("Grimoire.Domain.Message", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("ChannelId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("CreatedTimestamp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ReferencedMessageId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("ChannelId");

                    b.HasIndex("CreatedTimestamp");

                    b.HasIndex("GuildId");

                    b.HasIndex("UserId", "GuildId");

                    b.ToTable("Messages");
                });

            modelBuilder.Entity("Grimoire.Domain.MessageHistory", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<int>("Action")
                        .HasColumnType("integer");

                    b.Property<decimal?>("DeletedByModeratorId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("MessageContent")
                        .IsRequired()
                        .HasMaxLength(4000)
                        .HasColumnType("character varying(4000)");

                    b.Property<decimal>("MessageId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("TimeStamp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.HasKey("Id");

                    b.HasIndex("GuildId", "DeletedByModeratorId");

                    b.HasIndex("MessageId", "TimeStamp", "Action")
                        .IsDescending(false, true, false);

                    b.ToTable("MessageHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.Mute", b =>
                {
                    b.Property<long?>("SinId")
                        .HasColumnType("bigint");

                    b.Property<DateTimeOffset>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("SinId");

                    b.HasIndex("EndTime");

                    b.HasIndex("GuildId");

                    b.HasIndex("UserId", "GuildId")
                        .IsUnique();

                    b.ToTable("Mutes");
                });

            modelBuilder.Entity("Grimoire.Domain.NicknameHistory", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("Nickname")
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)");

                    b.Property<DateTimeOffset>("Timestamp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("GuildId");

                    b.HasIndex("UserId", "GuildId", "Timestamp")
                        .IsDescending(false, false, true);

                    b.ToTable("NicknameHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.OldLogMessage", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("ChannelId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<int>("TimesTried")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0);

                    b.HasKey("Id");

                    b.HasIndex("ChannelId");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("GuildId");

                    b.ToTable("OldLogMessages");
                });

            modelBuilder.Entity("Grimoire.Domain.Pardon", b =>
                {
                    b.Property<long>("SinId")
                        .HasColumnType("bigint");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ModeratorId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("PardonDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.HasKey("SinId");

                    b.HasIndex("GuildId");

                    b.HasIndex("ModeratorId", "GuildId");

                    b.ToTable("Pardons");
                });

            modelBuilder.Entity("Grimoire.Domain.PublishedMessage", b =>
                {
                    b.Property<long>("SinId")
                        .HasColumnType("bigint");

                    b.Property<int>("PublishType")
                        .HasColumnType("integer");

                    b.Property<decimal>("MessageId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("SinId", "PublishType");

                    b.ToTable("PublishedMessages");
                });

            modelBuilder.Entity("Grimoire.Domain.Reaction", b =>
                {
                    b.Property<decimal>("MessageId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("EmojiId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("ImageUrl")
                        .IsRequired()
                        .HasMaxLength(300)
                        .HasColumnType("character varying(300)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(32)
                        .HasColumnType("character varying(32)");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("MessageId", "EmojiId");

                    b.HasIndex("GuildId");

                    b.HasIndex("UserId", "GuildId");

                    b.ToTable("Reaction");
                });

            modelBuilder.Entity("Grimoire.Domain.Reward", b =>
                {
                    b.Property<decimal>("RoleId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<int>("RewardLevel")
                        .HasColumnType("integer");

                    b.Property<string>("RewardMessage")
                        .HasMaxLength(4096)
                        .HasColumnType("character varying(4096)");

                    b.HasKey("RoleId");

                    b.HasIndex("GuildId", "RewardLevel");

                    b.ToTable("Rewards");
                });

            modelBuilder.Entity("Grimoire.Domain.Role", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<bool>("IsXpIgnored")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.HasKey("Id");

                    b.HasIndex("GuildId");

                    b.HasIndex("IsXpIgnored")
                        .HasFilter("\"IsXpIgnored\" = TRUE");

                    b.ToTable("Roles");
                });

            modelBuilder.Entity("Grimoire.Domain.Sin", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ModeratorId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<DateTimeOffset>("SinOn")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<int>("SinType")
                        .HasColumnType("integer");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.HasIndex("GuildId");

                    b.HasIndex("ModeratorId", "GuildId");

                    b.HasIndex("UserId", "GuildId");

                    b.ToTable("Sins");
                });

            modelBuilder.Entity("Grimoire.Domain.Tracker", b =>
                {
                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<decimal>("LogChannelId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal?>("ModeratorId")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("UserId", "GuildId");

                    b.HasIndex("EndTime");

                    b.HasIndex("GuildId");

                    b.HasIndex("LogChannelId");

                    b.HasIndex("ModeratorId", "GuildId");

                    b.ToTable("Trackers");
                });

            modelBuilder.Entity("Grimoire.Domain.User", b =>
                {
                    b.Property<decimal>("Id")
                        .HasColumnType("numeric(20,0)");

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("Grimoire.Domain.UsernameHistory", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<DateTimeOffset>("Timestamp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<string>("Username")
                        .IsRequired()
                        .HasMaxLength(37)
                        .HasColumnType("character varying(37)");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.HasIndex("UserId", "Timestamp")
                        .IsDescending(false, true);

                    b.ToTable("UsernameHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.XpHistory", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property<long>("Id"));

                    b.Property<decimal?>("AwarderId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<decimal>("GuildId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTimeOffset>("TimeOut")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Type")
                        .HasColumnType("integer");

                    b.Property<decimal>("UserId")
                        .HasColumnType("numeric(20,0)");

                    b.Property<long>("Xp")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("GuildId");

                    b.HasIndex("AwarderId", "GuildId");

                    b.HasIndex("UserId", "GuildId", "TimeOut")
                        .IsDescending(false, false, true);

                    NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("UserId", "GuildId", "TimeOut"), new[] { "Xp" });

                    b.ToTable("XpHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.Attachment", b =>
                {
                    b.HasOne("Grimoire.Domain.Message", "Message")
                        .WithMany("Attachments")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Message");
                });

            modelBuilder.Entity("Grimoire.Domain.Avatar", b =>
                {
                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("AvatarHistory")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Member");
                });

            modelBuilder.Entity("Grimoire.Domain.Channel", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Channels")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");
                });

            modelBuilder.Entity("Grimoire.Domain.Guild", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "ModLogChannel")
                        .WithMany()
                        .HasForeignKey("ModChannelLog");

                    b.Navigation("ModLogChannel");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildLevelSettings", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithOne("LevelSettings")
                        .HasForeignKey("Grimoire.Domain.GuildLevelSettings", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Channel", "LevelChannelLog")
                        .WithMany()
                        .HasForeignKey("LevelChannelLogId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Guild");

                    b.Navigation("LevelChannelLog");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildMessageLogSettings", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "BulkDeleteChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildMessageLogSettings", "BulkDeleteChannelLogId");

                    b.HasOne("Grimoire.Domain.Channel", "DeleteChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildMessageLogSettings", "DeleteChannelLogId");

                    b.HasOne("Grimoire.Domain.Channel", "EditChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildMessageLogSettings", "EditChannelLogId");

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithOne("MessageLogSettings")
                        .HasForeignKey("Grimoire.Domain.GuildMessageLogSettings", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("BulkDeleteChannelLog");

                    b.Navigation("DeleteChannelLog");

                    b.Navigation("EditChannelLog");

                    b.Navigation("Guild");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildModerationSettings", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithOne("ModerationSettings")
                        .HasForeignKey("Grimoire.Domain.GuildModerationSettings", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Role", "MuteRoleNav")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildModerationSettings", "MuteRole");

                    b.Navigation("Guild");

                    b.Navigation("MuteRoleNav");
                });

            modelBuilder.Entity("Grimoire.Domain.GuildUserLogSettings", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "AvatarChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "AvatarChannelLogId");

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithOne("UserLogSettings")
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Channel", "JoinChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "JoinChannelLogId");

                    b.HasOne("Grimoire.Domain.Channel", "LeaveChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "LeaveChannelLogId");

                    b.HasOne("Grimoire.Domain.Channel", "NicknameChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "NicknameChannelLogId");

                    b.HasOne("Grimoire.Domain.Channel", "UsernameChannelLog")
                        .WithOne()
                        .HasForeignKey("Grimoire.Domain.GuildUserLogSettings", "UsernameChannelLogId");

                    b.Navigation("AvatarChannelLog");

                    b.Navigation("Guild");

                    b.Navigation("JoinChannelLog");

                    b.Navigation("LeaveChannelLog");

                    b.Navigation("NicknameChannelLog");

                    b.Navigation("UsernameChannelLog");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredChannel", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "Channel")
                        .WithOne("IsIgnoredChannel")
                        .HasForeignKey("Grimoire.Domain.IgnoredChannel", "ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("IgnoredChannels")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Channel");

                    b.Navigation("Guild");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredMember", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("IgnoredMembers")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithOne("IsIgnoredMember")
                        .HasForeignKey("Grimoire.Domain.IgnoredMember", "UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Member");
                });

            modelBuilder.Entity("Grimoire.Domain.IgnoredRole", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("IgnoredRoles")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Role", "Role")
                        .WithOne("IsIgnoredRole")
                        .HasForeignKey("Grimoire.Domain.IgnoredRole", "RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Role");
                });

            modelBuilder.Entity("Grimoire.Domain.Lock", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "Channel")
                        .WithOne("Lock")
                        .HasForeignKey("Grimoire.Domain.Lock", "ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("LockedChannels")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Moderator")
                        .WithMany("ChannelsLocked")
                        .HasForeignKey("ModeratorId", "GuildId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("Channel");

                    b.Navigation("Guild");

                    b.Navigation("Moderator");
                });

            modelBuilder.Entity("Grimoire.Domain.Member", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Members")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.User", "User")
                        .WithMany("MemberProfiles")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("User");
                });

            modelBuilder.Entity("Grimoire.Domain.Message", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "Channel")
                        .WithMany("Messages")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Messages")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("Messages")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Channel");

                    b.Navigation("Guild");

                    b.Navigation("Member");
                });

            modelBuilder.Entity("Grimoire.Domain.MessageHistory", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("MessageHistory")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Message", "Message")
                        .WithMany("MessageHistory")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "DeletedByModerator")
                        .WithMany("MessagesDeletedAsModerator")
                        .HasForeignKey("GuildId", "DeletedByModeratorId")
                        .HasPrincipalKey("GuildId", "UserId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("DeletedByModerator");

                    b.Navigation("Guild");

                    b.Navigation("Message");
                });

            modelBuilder.Entity("Grimoire.Domain.Mute", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("ActiveMutes")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Sin", "Sin")
                        .WithOne("Mute")
                        .HasForeignKey("Grimoire.Domain.Mute", "SinId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithOne("ActiveMute")
                        .HasForeignKey("Grimoire.Domain.Mute", "UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Member");

                    b.Navigation("Sin");
                });

            modelBuilder.Entity("Grimoire.Domain.NicknameHistory", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany()
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("NicknamesHistory")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Member");
                });

            modelBuilder.Entity("Grimoire.Domain.OldLogMessage", b =>
                {
                    b.HasOne("Grimoire.Domain.Channel", "Channel")
                        .WithMany("OldMessages")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("OldLogMessages")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Channel");

                    b.Navigation("Guild");
                });

            modelBuilder.Entity("Grimoire.Domain.Pardon", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany()
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Sin", "Sin")
                        .WithOne("Pardon")
                        .HasForeignKey("Grimoire.Domain.Pardon", "SinId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("Grimoire.Domain.Member", "Moderator")
                        .WithMany("SinsPardoned")
                        .HasForeignKey("ModeratorId", "GuildId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("Guild");

                    b.Navigation("Moderator");

                    b.Navigation("Sin");
                });

            modelBuilder.Entity("Grimoire.Domain.PublishedMessage", b =>
                {
                    b.HasOne("Grimoire.Domain.Sin", "Sin")
                        .WithMany("PublishMessages")
                        .HasForeignKey("SinId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Sin");
                });

            modelBuilder.Entity("Grimoire.Domain.Reaction", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany()
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Message", "Message")
                        .WithMany("Reactions")
                        .HasForeignKey("MessageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("Reactions")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Member");

                    b.Navigation("Message");
                });

            modelBuilder.Entity("Grimoire.Domain.Reward", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Rewards")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Role", "Role")
                        .WithOne("Reward")
                        .HasForeignKey("Grimoire.Domain.Reward", "RoleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Guild");

                    b.Navigation("Role");
                });

            modelBuilder.Entity("Grimoire.Domain.Role", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Roles")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");
                });

            modelBuilder.Entity("Grimoire.Domain.Sin", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Sins")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Moderator")
                        .WithMany("ModeratedSins")
                        .HasForeignKey("ModeratorId", "GuildId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("UserSins")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("Member");

                    b.Navigation("Moderator");
                });

            modelBuilder.Entity("Grimoire.Domain.Tracker", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("Trackers")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Channel", "LogChannel")
                        .WithMany("Trackers")
                        .HasForeignKey("LogChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Moderator")
                        .WithMany("TrackedUsers")
                        .HasForeignKey("ModeratorId", "GuildId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("Trackers")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Guild");

                    b.Navigation("LogChannel");

                    b.Navigation("Member");

                    b.Navigation("Moderator");
                });

            modelBuilder.Entity("Grimoire.Domain.UsernameHistory", b =>
                {
                    b.HasOne("Grimoire.Domain.User", "User")
                        .WithMany("UsernameHistories")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Grimoire.Domain.XpHistory", b =>
                {
                    b.HasOne("Grimoire.Domain.Guild", "Guild")
                        .WithMany("XpHistory")
                        .HasForeignKey("GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Grimoire.Domain.Member", "Awarder")
                        .WithMany("AwardRecipients")
                        .HasForeignKey("AwarderId", "GuildId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Grimoire.Domain.Member", "Member")
                        .WithMany("XpHistory")
                        .HasForeignKey("UserId", "GuildId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Awarder");

                    b.Navigation("Guild");

                    b.Navigation("Member");
                });

            modelBuilder.Entity("Grimoire.Domain.Channel", b =>
                {
                    b.Navigation("IsIgnoredChannel");

                    b.Navigation("Lock");

                    b.Navigation("Messages");

                    b.Navigation("OldMessages");

                    b.Navigation("Trackers");
                });

            modelBuilder.Entity("Grimoire.Domain.Guild", b =>
                {
                    b.Navigation("ActiveMutes");

                    b.Navigation("Channels");

                    b.Navigation("IgnoredChannels");

                    b.Navigation("IgnoredMembers");

                    b.Navigation("IgnoredRoles");

                    b.Navigation("LevelSettings")
                        .IsRequired();

                    b.Navigation("LockedChannels");

                    b.Navigation("Members");

                    b.Navigation("MessageHistory");

                    b.Navigation("MessageLogSettings")
                        .IsRequired();

                    b.Navigation("Messages");

                    b.Navigation("ModerationSettings")
                        .IsRequired();

                    b.Navigation("OldLogMessages");

                    b.Navigation("Rewards");

                    b.Navigation("Roles");

                    b.Navigation("Sins");

                    b.Navigation("Trackers");

                    b.Navigation("UserLogSettings")
                        .IsRequired();

                    b.Navigation("XpHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.Member", b =>
                {
                    b.Navigation("ActiveMute");

                    b.Navigation("AvatarHistory");

                    b.Navigation("AwardRecipients");

                    b.Navigation("ChannelsLocked");

                    b.Navigation("IsIgnoredMember");

                    b.Navigation("Messages");

                    b.Navigation("MessagesDeletedAsModerator");

                    b.Navigation("ModeratedSins");

                    b.Navigation("NicknamesHistory");

                    b.Navigation("Reactions");

                    b.Navigation("SinsPardoned");

                    b.Navigation("TrackedUsers");

                    b.Navigation("Trackers");

                    b.Navigation("UserSins");

                    b.Navigation("XpHistory");
                });

            modelBuilder.Entity("Grimoire.Domain.Message", b =>
                {
                    b.Navigation("Attachments");

                    b.Navigation("MessageHistory");

                    b.Navigation("Reactions");
                });

            modelBuilder.Entity("Grimoire.Domain.Role", b =>
                {
                    b.Navigation("IsIgnoredRole");

                    b.Navigation("Reward");
                });

            modelBuilder.Entity("Grimoire.Domain.Sin", b =>
                {
                    b.Navigation("Mute");

                    b.Navigation("Pardon");

                    b.Navigation("PublishMessages");
                });

            modelBuilder.Entity("Grimoire.Domain.User", b =>
                {
                    b.Navigation("MemberProfiles");

                    b.Navigation("UsernameHistories");
                });
#pragma warning restore 612, 618
        }
    }
}
