context: using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.Data.Entity;
  using System.Data.Entity.Infrastructure;
  using System.Data.Entity.Validation;
  using System.Diagnostics;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using ZkData.Migrations;
  
  namespace ZkData
  {
      public partial class ZkDataContext : DbContext
      {
          public virtual DbSet<AbuseReport> AbuseReports { get; set; }
          public virtual DbSet<Account> Accounts { get; set; }
          public virtual DbSet<AccountBattleAward> AccountBattleAwards { get; set; }
          public virtual DbSet<AccountCampaignJournalProgress> AccountCampaignJournalProgress { get; set; }
          public virtual DbSet<AccountCampaignProgress> AccountCampaignProgress { get; set; }
          public virtual DbSet<AccountCampaignVar> AccountCampaignVars { get; set; }
          public virtual DbSet<AccountForumVote> AccountForumVotes { get; set; }
          public virtual DbSet<AccountIP> AccountIPs { get; set; }
          public virtual DbSet<AccountPlanet> AccountPlanets { get; set; }
          public virtual DbSet<AccountRole> AccountRoles { get; set; }
          public virtual DbSet<AccountUnlock> AccountUnlocks { get; set; }
          public virtual DbSet<AccountUserID> AccountUserIDs { get; set; }
          public virtual DbSet<Avatar> Avatars { get; set; }
          public virtual DbSet<BlockedCompany> BlockedCompanies { get; set; }
          public virtual DbSet<BlockedHost> BlockedHosts { get; set; }
          public virtual DbSet<Campaign> Campaigns { get; set; }
          public virtual DbSet<CampaignEvent> CampaignEvents { get; set; }
          public virtual DbSet<CampaignJournal> CampaignJournals { get; set; }
          public virtual DbSet<CampaignJournalVar> CampaignJournalVars { get; set; }
          public virtual DbSet<CampaignLink> CampaignLinks { get; set; }
          public virtual DbSet<CampaignPlanet> CampaignPlanets { get; set; }
          public virtual DbSet<CampaignPlanetVar> CampaignPlanetVars { get; set; }
          public virtual DbSet<CampaignVar> CampaignVars { get; set; }
          public virtual DbSet<Clan> Clans { get; set; }
          public virtual DbSet<Commander> Commanders { get; set; }
          public virtual DbSet<CommanderDecoration> CommanderDecorations { get; set; }
          public virtual DbSet<CommanderDecorationIcon> CommanderDecorationIcons { get; set; }
          public virtual DbSet<CommanderDecorationSlot> CommanderDecorationSlots { get; set; }
          public virtual DbSet<CommanderModule> CommanderModules { get; set; }
          public virtual DbSet<CommanderSlot> CommanderSlots { get; set; }
          public virtual DbSet<Contribution> Contributions { get; set; }
          public virtual DbSet<ContributionJar> ContributionJars { get; set; }
          public virtual DbSet<Event> Events { get; set; }
          public virtual DbSet<Faction> Factions { get; set; }
          public virtual DbSet<FactionTreaty> FactionTreaties { get; set; }
          public virtual DbSet<ForumCategory> ForumCategories { get; set; }
          public virtual DbSet<ForumLastRead> ForumLastReads { get; set; }
          public virtual DbSet<ForumPost> ForumPosts { get; set; }
          public virtual DbSet<ForumPostEdit> ForumPostEdits { get; set; }
          public virtual DbSet<ForumThread> ForumThreads { get; set; }
          public virtual DbSet<ForumThreadLastRead> ForumThreadLastReads { get; set; }
          public virtual DbSet<Galaxy> Galaxies { get; set; }
          public virtual DbSet<KudosPurchase> KudosPurchases { get; set; }
          public virtual DbSet<Link> Links { get; set; }
          public virtual DbSet<MapRating> MapRatings { get; set; }
          public virtual DbSet<Mission> Missions { get; set; }
          public virtual DbSet<MissionScore> MissionScores { get; set; }
          public virtual DbSet<News> News { get; set; }
          public virtual DbSet<Planet> Planets { get; set; }
          public virtual DbSet<PlanetFaction> PlanetFactions { get; set; }
          public virtual DbSet<PlanetOwnerHistory> PlanetOwnerHistories { get; set; }
          public virtual DbSet<PlanetStructure> PlanetStructures { get; set; }
          public virtual DbSet<Poll> Polls { get; set; }
          public virtual DbSet<PollOption> PollOptions { get; set; }
          public virtual DbSet<PollVote> PollVotes { get; set; }
          public virtual DbSet<Punishment> Punishments { get; set; }
          public virtual DbSet<Rating> Ratings { get; set; }
          public virtual DbSet<Resource> Resources { get; set; }
          public virtual DbSet<ResourceContentFile> ResourceContentFiles { get; set; }
          public virtual DbSet<ResourceDependency> ResourceDependencies { get; set; }
          public virtual DbSet<RoleType> RoleTypes { get; set; }
          public virtual DbSet<RoleTypeHierarchy> RoleTypeHierarchies { get; set; }
          public virtual DbSet<SpringBattle> SpringBattles { get; set; }
          public virtual DbSet<SpringBattlePlayer> SpringBattlePlayers { get; set; }
          public virtual DbSet<StructureType> StructureTypes { get; set; }
          public virtual DbSet<TreatyEffect> TreatyEffects { get; set; }
          public virtual DbSet<TreatyEffectType> TreatyEffectTypes { get; set; }
          public virtual DbSet<Unlock> Unlocks { get; set; }
          public virtual DbSet<MiscVar> MiscVars { get; set; }
          public virtual DbSet<LobbyChatHistory> LobbyChatHistories { get; set; }
          public virtual DbSet<LogEntry> LogEntries { get; set; }
          public virtual DbSet<Word> IndexWords { get; set; }
          public virtual DbSet<ForumPostWord> IndexForumPosts { get; set; }
          public virtual DbSet<AccountRelation> AccountRelations { get; set; }
          public virtual DbSet<SpringBattleBot> SpringBattleBots { get; set; }
  
          public virtual DbSet<LobbyChannelTopic> LobbyChannelTopics { get; set; }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Entity<Account>()
                  .Property(e => e.Name)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Account>()
                  .Property(e => e.Aliases)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Account>()
                  .Property(e => e.Country)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Account>()
                  .Property(e => e.SteamID)
                  .HasPrecision(38, 0);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AbuseReportsByAccountID)
                  .WithRequired(e => e.AccountByAccountID)
                  .HasForeignKey(e => e.AccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AbuseReportsByReporterAccountID)
                  .WithRequired(e => e.AccountByReporterAccountID)
                  .HasForeignKey(e => e.ReporterAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountBattleAwards)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountCampaignJournalProgresses)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountForumVotes)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountRolesByAccountID)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.AccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountUnlocks)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.CampaignEvents)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.AccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.Commanders)
                  .WithRequired(e => e.AccountByAccountID)
                  .HasForeignKey(e => e.AccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ContributionsByAccountID)
                  .WithOptional(e => e.AccountByAccountID)
                  .HasForeignKey(e => e.AccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ContributionsByManuallyAddedAccountID)
                  .WithOptional(e => e.AccountByManuallyAddedID)
                  .HasForeignKey(e => e.ManuallyAddedAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ContributionJars)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.GuarantorAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.FactionTreatiesByProposingAccount)
                  .WithRequired(e => e.AccountByProposingAccountID)
                  .HasForeignKey(e => e.ProposingAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.FactionTreatiesByAcceptedAccountID)
                  .WithOptional(e => e.AccountByAcceptedAccountID)
                  .HasForeignKey(e => e.AcceptedAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumLastReads)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumPostEdits)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.EditorAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumThreads)
                  .WithOptional(e => e.AccountByCreatedAccountID)
                  .HasForeignKey(e => e.CreatedAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumThreadsByLastPostAccountID)
                  .WithOptional(e => e.AccountByLastPostAccountID)
                  .HasForeignKey(e => e.LastPostAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumThreadLastReads)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.KudosPurchases)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.Missions)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.MissionScores)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.News)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.AuthorAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.Planets)
                  .WithOptional(e => e.Account)
                  .HasForeignKey(e => e.OwnerAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PlanetOwnerHistories)
                  .WithOptional(e => e.Account)
                  .HasForeignKey(e => e.OwnerAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PlanetStructures)
                  .WithOptional(e => e.Account)
                  .HasForeignKey(e => e.OwnerAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.AccountPlanets)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PollsByRoleTargetAccountID)
                  .WithOptional(e => e.AccountByRoleTargetAccountID)
                  .HasForeignKey(e => e.RoleTargetAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PollsByCreatedAccountID)
                  .WithOptional(e => e.CreatedAccount)
                  .HasForeignKey(e => e.CreatedAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PollVotes)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PunishmentsByAccountID)
                  .WithRequired(e => e.AccountByAccountID)
                  .HasForeignKey(e => e.AccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.PunishmentsByCreatedAccountID)
                  .WithOptional(e => e.AccountByCreatedAccountID)
                  .HasForeignKey(e => e.CreatedAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.Ratings)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.Resources)
                  .WithOptional(e => e.Account)
                  .HasForeignKey(e => e.TaggedByAccountID);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.MapRatings)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.SpringBattles)
                  .WithOptional(e => e.Account)
                  .HasForeignKey(e => e.HostAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.SpringBattlePlayers)
                  .WithRequired(e => e.Account)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasOptional(e => e.Clan)
                  .WithMany(e => e.Accounts)
                  .HasForeignKey(e => e.ClanID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Account>()
                  .HasMany(e => e.ForumPosts)
                  .WithRequired(e => e.Account)
                  .HasForeignKey(e => e.AuthorAccountID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<AccountBattleAward>()
                  .Property(e => e.AwardKey)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.AccountCampaignJournalProgresses)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.AccountCampaignProgresses)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.AccountCampaignVars)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.CampaignEvents)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.CampaignJournalVars)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.CampaignLinks)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.CampaignPlanetVars)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Campaign>()
                  .HasMany(e => e.CampaignVars)
                  .WithRequired(e => e.Campaign)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignLink>().HasKey(x => new { x.CampaignID, x.PlanetToUnlockID, x.UnlockingPlanetID });
  
              modelBuilder.Entity<CampaignJournal>()
                  .HasMany(e => e.AccountCampaignJournalProgress)
                  .WithRequired(e => e.CampaignJournal)
                  .HasForeignKey(e => new { e.CampaignID, e.JournalID });
  
              modelBuilder.Entity<CampaignJournal>()
                  .HasMany(e => e.CampaignJournalVars)
                  .WithRequired(e => e.CampaignJournal)
                  .HasForeignKey(e => new { e.CampaignID, e.JournalID });
  
  
              modelBuilder.Entity<CampaignPlanet>().HasKey(x => new { x.CampaignID, x.PlanetID });
  
  
              modelBuilder.Entity<CampaignPlanet>()
                  .Property(e => e.Name)
                  .IsUnicode(false);
  
              modelBuilder.Entity<CampaignPlanet>()
                  .HasMany(e => e.AccountCampaignProgress)
                  .WithRequired(e => e.CampaignPlanet)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignPlanet>()
                  .HasMany(e => e.CampaignEvents)
                  .WithOptional(e => e.CampaignPlanet)
                  .HasForeignKey(e => new { e.CampaignID, e.PlanetID })
                  .WillCascadeOnDelete();
  
              modelBuilder.Entity<CampaignPlanet>().HasMany(e => e.CampaignJournals).WithOptional(e => e.CampaignPlanet);
  
              modelBuilder.Entity<CampaignPlanet>()
                  .HasMany(e => e.CampaignLinksByPlanetToUnlock)
                  .WithRequired(e => e.PlanetToUnlock)
                  .HasForeignKey(e => new { e.CampaignID, e.PlanetToUnlockID })
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignPlanet>()
                  .HasMany(e => e.CampaignLinksByUnlockingPlanet)
                  .WithRequired(e => e.UnlockingPlanet)
                  .HasForeignKey(e => new { e.CampaignID, e.UnlockingPlanetID })
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignPlanet>()
                  .HasMany(e => e.CampaignPlanetVars)
                  .WithRequired(e => e.CampaignPlanet)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignVar>()
                  .HasMany(e => e.AccountCampaignVars)
                  .WithRequired(e => e.CampaignVar)
                  .HasForeignKey(e => new { e.CampaignID, e.VarID })
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignVar>()
                  .HasMany(e => e.CampaignJournalVars)
                  .WithRequired(e => e.CampaignVar)
                  .HasForeignKey(e => new { e.CampaignID, e.RequiredVarID })
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CampaignVar>()
                  .HasMany(e => e.CampaignPlanetVars)
                  .WithRequired(e => e.CampaignVar)
                  .HasForeignKey(e => new { e.CampaignID, e.RequiredVarID })
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Clan>()
                  .Property(e => e.ClanName)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Clan>()
                  .Property(e => e.Description)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Clan>()
                  .Property(e => e.Password)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Clan>()
                  .Property(e => e.Shortcut)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Clan>()
                  .HasMany(e => e.AccountRoles)
                  .WithOptional(e => e.Clan)
                  .WillCascadeOnDelete();
  
              modelBuilder.Entity<Clan>()
                  .HasMany(e => e.ForumThreads)
                  .WithOptional(e => e.Clan)
                  .HasForeignKey(e => e.RestrictedClanID)
                  .WillCascadeOnDelete();
  
              modelBuilder.Entity<Clan>()
                  .HasMany(e => e.PlanetOwnerHistories)
                  .WithOptional(e => e.Clan)
                  .HasForeignKey(e => e.OwnerClanID);
  
              modelBuilder.Entity<Clan>()
                  .HasMany(e => e.Events)
                  .WithMany(e => e.Clans)
                  .Map(m => m.ToTable("EventClan").MapLeftKey("ClanID").MapRightKey("EventID"));
  
              modelBuilder.Entity<Clan>()
                  .HasMany(e => e.Polls)
                  .WithOptional(e => e.Clan)
                  .HasForeignKey(e => e.RestrictClanID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<CommanderDecorationSlot>()
                  .HasMany(e => e.CommanderDecorations)
                  .WithRequired(e => e.CommanderDecorationSlot)
                  .HasForeignKey(e => e.SlotID);
  
              modelBuilder.Entity<CommanderSlot>()
                  .HasMany(e => e.CommanderModules)
                  .WithRequired(e => e.CommanderSlot)
                  .HasForeignKey(e => e.SlotID);
  
              modelBuilder.Entity<Event>()
                  .HasMany(e => e.Accounts)
                  .WithMany(e => e.Events)
                  .Map(m => m.ToTable("EventAccount").MapLeftKey("EventID").MapRightKey("AccountID"));
  
              modelBuilder.Entity<Event>()
                  .HasMany(e => e.Factions)
                  .WithMany(e => e.Events)
                  .Map(m => m.ToTable("EventFaction").MapLeftKey("EventID").MapRightKey("FactionID"));
  
              modelBuilder.Entity<Event>()
                  .HasMany(e => e.Planets)
                  .WithMany(e => e.Events)
                  .Map(m => m.ToTable("EventPlanet").MapLeftKey("EventID").MapRightKey("PlanetID"));
  
              modelBuilder.Entity<Event>()
                  .HasMany(e => e.SpringBattles)
                  .WithMany(e => e.Events)
                  .Map(m => m.ToTable("EventSpringBattle").MapLeftKey("EventID").MapRightKey("SpringBattleID"));
  
              modelBuilder.Entity<Faction>()
                  .Property(e => e.Color)
                  .IsUnicode(false);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.FactionTreatiesByProposingFaction)
                  .WithRequired(e => e.FactionByProposingFactionID)
                  .HasForeignKey(e => e.ProposingFactionID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.FactionTreatiesByAcceptingFaction)
                  .WithRequired(e => e.FactionByAcceptingFactionID)
                  .HasForeignKey(e => e.AcceptingFactionID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.Planets)
                  .WithOptional(e => e.Faction)
                  .HasForeignKey(e => e.OwnerFactionID);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.PlanetFactions)
                  .WithRequired(e => e.Faction)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.PlanetOwnerHistories)
                  .WithOptional(e => e.Faction)
                  .HasForeignKey(e => e.OwnerFactionID);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.Polls)
                  .WithOptional(e => e.Faction)
                  .HasForeignKey(e => e.RestrictFactionID);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.RoleTypes)
                  .WithOptional(e => e.Faction)
                  .HasForeignKey(e => e.RestrictFactionID);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.TreatyEffectsByGivingFactionID)
                  .WithRequired(e => e.FactionByGivingFactionID)
                  .HasForeignKey(e => e.GivingFactionID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<Faction>()
                  .HasMany(e => e.TreatyEffectsByReceivingFactionID)
                  .WithRequired(e => e.FactionByReceivingFactionID)
                  .HasForeignKey(e => e.ReceivingFactionID)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<ForumCategory>()
                  .HasMany(e => e.ChildForumCategories)
                  .WithOptional(e => e.ParentForumCategory)
                  .HasForeignKey(e => e.ParentForumCategoryID);
  
              modelBuilder.Entity<ForumCategory>()
                  .HasMany(e => e.ForumLastReads)
                  .WithRequired(e => e.ForumCategory)
                  .WillCascadeOnDelete(false);
  
              modelBuilder.Entity<ForumCategory>()
  
gt:                 .HasMany(e => e.ForumThreads)