From 2e4f013812149300d61b99418caa062fd86c6f26 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 16 May 2020 12:00:30 -0400 Subject: [PATCH] Code cleanups --- .../Database/DatabaseSeeder.cs | 4 +- ...PostgresSqlDatabaseContextModelSnapshot.cs | 1275 ++++++++--------- 2 files changed, 639 insertions(+), 640 deletions(-) diff --git a/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs b/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs index 694f5e4da9..ec15fb3e3c 100644 --- a/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs +++ b/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs @@ -69,8 +69,8 @@ namespace Tgstation.Server.Host.Database // Fix the issue with ulong enums // https://github.com/tgstation/tgstation-server/commit/db341d43b3dab74fe3681f5172ca9bfeaafa6b6d#diff-09f06ec4584665cf89bb77b97f5ccfb9R36-R39 // https://github.com/JamesNK/Newtonsoft.Json/issues/2301 - admin.AdministrationRights = admin.AdministrationRights & RightsHelper.AllRights(); - admin.InstanceManagerRights = admin.InstanceManagerRights & RightsHelper.AllRights(); + admin.AdministrationRights &= RightsHelper.AllRights(); + admin.InstanceManagerRights &= RightsHelper.AllRights(); } if (platformIdentifier.IsWindows) diff --git a/src/Tgstation.Server.Host/Database/Migrations/PostgresSqlDatabaseContextModelSnapshot.cs b/src/Tgstation.Server.Host/Database/Migrations/PostgresSqlDatabaseContextModelSnapshot.cs index 277d665476..fd44242293 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/PostgresSqlDatabaseContextModelSnapshot.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/PostgresSqlDatabaseContextModelSnapshot.cs @@ -2,814 +2,813 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Migrations { - [DbContext(typeof(PostgresSqlDatabaseContext))] - partial class PostgresSqlDatabaseContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { + [DbContext(typeof(PostgresSqlDatabaseContext))] + partial class PostgresSqlDatabaseContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { #pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) - .HasAnnotation("ProductVersion", "3.1.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ChannelLimit") - .HasColumnType("integer"); + b.Property("ChannelLimit") + .HasColumnType("integer"); - b.Property("ConnectionString") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("ConnectionString") + .IsRequired() + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("Enabled") - .HasColumnType("boolean"); + b.Property("Enabled") + .HasColumnType("boolean"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("Name") - .IsRequired() - .HasColumnType("character varying(100)") - .HasMaxLength(100); + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(100)") + .HasMaxLength(100); - b.Property("Provider") - .HasColumnType("integer"); + b.Property("Provider") + .HasColumnType("integer"); - b.Property("ReconnectionInterval") - .HasColumnType("bigint"); + b.Property("ReconnectionInterval") + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId", "Name") - .IsUnique(); + b.HasIndex("InstanceId", "Name") + .IsUnique(); - b.ToTable("ChatBots"); - }); + b.ToTable("ChatBots"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ChatSettingsId") - .HasColumnType("bigint"); + b.Property("ChatSettingsId") + .HasColumnType("bigint"); - b.Property("DiscordChannelId") - .HasColumnType("numeric(20,0)"); + b.Property("DiscordChannelId") + .HasColumnType("numeric(20,0)"); - b.Property("IrcChannel") - .HasColumnType("character varying(100)") - .HasMaxLength(100); + b.Property("IrcChannel") + .HasColumnType("character varying(100)") + .HasMaxLength(100); - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("boolean"); + b.Property("IsAdminChannel") + .IsRequired() + .HasColumnType("boolean"); - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("boolean"); + b.Property("IsUpdatesChannel") + .IsRequired() + .HasColumnType("boolean"); - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("boolean"); + b.Property("IsWatchdogChannel") + .IsRequired() + .HasColumnType("boolean"); - b.Property("Tag") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("Tag") + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ChatSettingsId", "DiscordChannelId") - .IsUnique(); + b.HasIndex("ChatSettingsId", "DiscordChannelId") + .IsUnique(); - b.HasIndex("ChatSettingsId", "IrcChannel") - .IsUnique(); + b.HasIndex("ChatSettingsId", "IrcChannel") + .IsUnique(); - b.ToTable("ChatChannels"); - }); + b.ToTable("ChatChannels"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ByondVersion") - .IsRequired() - .HasColumnType("text"); + b.Property("ByondVersion") + .IsRequired() + .HasColumnType("text"); - b.Property("DMApiMajorVersion") - .HasColumnType("integer"); + b.Property("DMApiMajorVersion") + .HasColumnType("integer"); - b.Property("DMApiMinorVersion") - .HasColumnType("integer"); + b.Property("DMApiMinorVersion") + .HasColumnType("integer"); - b.Property("DMApiPatchVersion") - .HasColumnType("integer"); + b.Property("DMApiPatchVersion") + .HasColumnType("integer"); - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("uuid"); + b.Property("DirectoryName") + .IsRequired() + .HasColumnType("uuid"); - b.Property("DmeName") - .IsRequired() - .HasColumnType("text"); + b.Property("DmeName") + .IsRequired() + .HasColumnType("text"); - b.Property("JobId") - .HasColumnType("bigint"); + b.Property("JobId") + .HasColumnType("bigint"); - b.Property("MinimumSecurityLevel") - .HasColumnType("integer"); + b.Property("MinimumSecurityLevel") + .HasColumnType("integer"); - b.Property("Output") - .IsRequired() - .HasColumnType("text"); + b.Property("Output") + .IsRequired() + .HasColumnType("text"); - b.Property("RevisionInformationId") - .HasColumnType("bigint"); + b.Property("RevisionInformationId") + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("DirectoryName"); + b.HasIndex("DirectoryName"); - b.HasIndex("JobId") - .IsUnique(); + b.HasIndex("JobId") + .IsUnique(); - b.HasIndex("RevisionInformationId"); + b.HasIndex("RevisionInformationId"); - b.ToTable("CompileJobs"); - }); + b.ToTable("CompileJobs"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("boolean"); + b.Property("AllowWebClient") + .IsRequired() + .HasColumnType("boolean"); - b.Property("AutoStart") - .IsRequired() - .HasColumnType("boolean"); + b.Property("AutoStart") + .IsRequired() + .HasColumnType("boolean"); - b.Property("HeartbeatSeconds") - .HasColumnType("bigint"); + b.Property("HeartbeatSeconds") + .HasColumnType("bigint"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("PrimaryPort") - .HasColumnType("integer"); + b.Property("PrimaryPort") + .HasColumnType("integer"); - b.Property("SecondaryPort") - .HasColumnType("integer"); + b.Property("SecondaryPort") + .HasColumnType("integer"); - b.Property("SecurityLevel") - .HasColumnType("integer"); + b.Property("SecurityLevel") + .HasColumnType("integer"); - b.Property("StartupTimeout") - .HasColumnType("bigint"); + b.Property("StartupTimeout") + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId") - .IsUnique(); + b.HasIndex("InstanceId") + .IsUnique(); - b.ToTable("DreamDaemonSettings"); - }); + b.ToTable("DreamDaemonSettings"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ApiValidationPort") - .HasColumnType("integer"); + b.Property("ApiValidationPort") + .HasColumnType("integer"); - b.Property("ApiValidationSecurityLevel") - .HasColumnType("integer"); + b.Property("ApiValidationSecurityLevel") + .HasColumnType("integer"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("ProjectName") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("ProjectName") + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId") - .IsUnique(); + b.HasIndex("InstanceId") + .IsUnique(); - b.ToTable("DreamMakerSettings"); - }); + b.ToTable("DreamMakerSettings"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.DualReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.DualReattachInformation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("AlphaId") - .HasColumnType("bigint"); + b.Property("AlphaId") + .HasColumnType("bigint"); - b.Property("AlphaIsActive") - .HasColumnType("boolean"); + b.Property("AlphaIsActive") + .HasColumnType("boolean"); - b.Property("BravoId") - .HasColumnType("bigint"); + b.Property("BravoId") + .HasColumnType("bigint"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("AlphaId"); + b.HasIndex("AlphaId"); - b.HasIndex("BravoId"); + b.HasIndex("BravoId"); - b.HasIndex("InstanceId") - .IsUnique(); + b.HasIndex("InstanceId") + .IsUnique(); - b.ToTable("WatchdogReattachInformations"); - }); + b.ToTable("WatchdogReattachInformations"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("AutoUpdateInterval") - .HasColumnType("bigint"); + b.Property("AutoUpdateInterval") + .HasColumnType("bigint"); - b.Property("ChatBotLimit") - .HasColumnType("integer"); + b.Property("ChatBotLimit") + .HasColumnType("integer"); - b.Property("ConfigurationType") - .HasColumnType("integer"); + b.Property("ConfigurationType") + .HasColumnType("integer"); - b.Property("Name") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("Online") - .IsRequired() - .HasColumnType("boolean"); + b.Property("Online") + .IsRequired() + .HasColumnType("boolean"); - b.Property("Path") - .IsRequired() - .HasColumnType("text"); + b.Property("Path") + .IsRequired() + .HasColumnType("text"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("Path") - .IsUnique(); + b.HasIndex("Path") + .IsUnique(); - b.ToTable("Instances"); - }); + b.ToTable("Instances"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ByondRights") - .HasColumnType("numeric(20,0)"); + b.Property("ByondRights") + .HasColumnType("numeric(20,0)"); - b.Property("ChatBotRights") - .HasColumnType("numeric(20,0)"); + b.Property("ChatBotRights") + .HasColumnType("numeric(20,0)"); - b.Property("ConfigurationRights") - .HasColumnType("numeric(20,0)"); + b.Property("ConfigurationRights") + .HasColumnType("numeric(20,0)"); - b.Property("DreamDaemonRights") - .HasColumnType("numeric(20,0)"); + b.Property("DreamDaemonRights") + .HasColumnType("numeric(20,0)"); - b.Property("DreamMakerRights") - .HasColumnType("numeric(20,0)"); + b.Property("DreamMakerRights") + .HasColumnType("numeric(20,0)"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("InstanceUserRights") - .HasColumnType("numeric(20,0)"); + b.Property("InstanceUserRights") + .HasColumnType("numeric(20,0)"); - b.Property("RepositoryRights") - .HasColumnType("numeric(20,0)"); + b.Property("RepositoryRights") + .HasColumnType("numeric(20,0)"); - b.Property("UserId") - .IsRequired() - .HasColumnType("bigint"); + b.Property("UserId") + .IsRequired() + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId"); + b.HasIndex("InstanceId"); - b.HasIndex("UserId", "InstanceId") - .IsUnique(); + b.HasIndex("UserId", "InstanceId") + .IsUnique(); - b.ToTable("InstanceUsers"); - }); + b.ToTable("InstanceUsers"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("CancelRight") - .HasColumnType("numeric(20,0)"); + b.Property("CancelRight") + .HasColumnType("numeric(20,0)"); - b.Property("CancelRightsType") - .HasColumnType("numeric(20,0)"); + b.Property("CancelRightsType") + .HasColumnType("numeric(20,0)"); - b.Property("Cancelled") - .IsRequired() - .HasColumnType("boolean"); + b.Property("Cancelled") + .IsRequired() + .HasColumnType("boolean"); - b.Property("CancelledById") - .HasColumnType("bigint"); + b.Property("CancelledById") + .HasColumnType("bigint"); - b.Property("Description") - .IsRequired() - .HasColumnType("text"); + b.Property("Description") + .IsRequired() + .HasColumnType("text"); - b.Property("ErrorCode") - .HasColumnType("bigint"); + b.Property("ErrorCode") + .HasColumnType("bigint"); - b.Property("ExceptionDetails") - .HasColumnType("text"); + b.Property("ExceptionDetails") + .HasColumnType("text"); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("StartedAt") - .IsRequired() - .HasColumnType("timestamp with time zone"); + b.Property("StartedAt") + .IsRequired() + .HasColumnType("timestamp with time zone"); - b.Property("StartedById") - .HasColumnType("bigint"); + b.Property("StartedById") + .HasColumnType("bigint"); - b.Property("StoppedAt") - .HasColumnType("timestamp with time zone"); + b.Property("StoppedAt") + .HasColumnType("timestamp with time zone"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("CancelledById"); + b.HasIndex("CancelledById"); - b.HasIndex("InstanceId"); + b.HasIndex("InstanceId"); - b.HasIndex("StartedById"); + b.HasIndex("StartedById"); - b.ToTable("Jobs"); - }); + b.ToTable("Jobs"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("AccessIdentifier") - .IsRequired() - .HasColumnType("text"); + b.Property("AccessIdentifier") + .IsRequired() + .HasColumnType("text"); - b.Property("CompileJobId") - .HasColumnType("bigint"); + b.Property("CompileJobId") + .HasColumnType("bigint"); - b.Property("IsPrimary") - .HasColumnType("boolean"); + b.Property("IsPrimary") + .HasColumnType("boolean"); - b.Property("LaunchSecurityLevel") - .HasColumnType("integer"); + b.Property("LaunchSecurityLevel") + .HasColumnType("integer"); - b.Property("Port") - .HasColumnType("integer"); + b.Property("Port") + .HasColumnType("integer"); - b.Property("ProcessId") - .HasColumnType("integer"); + b.Property("ProcessId") + .HasColumnType("integer"); - b.Property("RebootState") - .HasColumnType("integer"); + b.Property("RebootState") + .HasColumnType("integer"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("CompileJobId"); + b.HasIndex("CompileJobId"); - b.ToTable("ReattachInformations"); - }); + b.ToTable("ReattachInformations"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("AccessToken") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("AccessToken") + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("AccessUser") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("AccessUser") + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("boolean"); + b.Property("AutoUpdatesKeepTestMerges") + .IsRequired() + .HasColumnType("boolean"); - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("boolean"); + b.Property("AutoUpdatesSynchronize") + .IsRequired() + .HasColumnType("boolean"); - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("CommitterEmail") + .IsRequired() + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("CommitterName") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("CommitterName") + .IsRequired() + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("boolean"); + b.Property("PostTestMergeComment") + .IsRequired() + .HasColumnType("boolean"); - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("boolean"); + b.Property("PushTestMergeCommits") + .IsRequired() + .HasColumnType("boolean"); - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("boolean"); + b.Property("ShowTestMergeCommitters") + .IsRequired() + .HasColumnType("boolean"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId") - .IsUnique(); + b.HasIndex("InstanceId") + .IsUnique(); - b.ToTable("RepositorySettings"); - }); + b.ToTable("RepositorySettings"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("RevisionInformationId") - .HasColumnType("bigint"); + b.Property("RevisionInformationId") + .HasColumnType("bigint"); - b.Property("TestMergeId") - .HasColumnType("bigint"); + b.Property("TestMergeId") + .HasColumnType("bigint"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("RevisionInformationId"); + b.HasIndex("RevisionInformationId"); - b.HasIndex("TestMergeId"); + b.HasIndex("TestMergeId"); - b.ToTable("RevInfoTestMerges"); - }); + b.ToTable("RevInfoTestMerges"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("CommitSha") - .IsRequired() - .HasColumnType("character varying(40)") - .HasMaxLength(40); + b.Property("CommitSha") + .IsRequired() + .HasColumnType("character varying(40)") + .HasMaxLength(40); - b.Property("InstanceId") - .HasColumnType("bigint"); + b.Property("InstanceId") + .HasColumnType("bigint"); - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("character varying(40)") - .HasMaxLength(40); + b.Property("OriginCommitSha") + .IsRequired() + .HasColumnType("character varying(40)") + .HasMaxLength(40); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("InstanceId", "CommitSha") - .IsUnique(); + b.HasIndex("InstanceId", "CommitSha") + .IsUnique(); - b.ToTable("RevisionInformations"); - }); + b.ToTable("RevisionInformations"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("Author") - .IsRequired() - .HasColumnType("text"); + b.Property("Author") + .IsRequired() + .HasColumnType("text"); - b.Property("BodyAtMerge") - .IsRequired() - .HasColumnType("text"); + b.Property("BodyAtMerge") + .IsRequired() + .HasColumnType("text"); - b.Property("Comment") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); + b.Property("Comment") + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); - b.Property("MergedAt") - .HasColumnType("timestamp with time zone"); + b.Property("MergedAt") + .HasColumnType("timestamp with time zone"); - b.Property("MergedById") - .HasColumnType("bigint"); + b.Property("MergedById") + .HasColumnType("bigint"); - b.Property("Number") - .HasColumnType("integer"); + b.Property("Number") + .HasColumnType("integer"); - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("bigint"); + b.Property("PrimaryRevisionInformationId") + .IsRequired() + .HasColumnType("bigint"); - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("character varying(40)") - .HasMaxLength(40); + b.Property("PullRequestRevision") + .IsRequired() + .HasColumnType("character varying(40)") + .HasMaxLength(40); - b.Property("TitleAtMerge") - .IsRequired() - .HasColumnType("text"); + b.Property("TitleAtMerge") + .IsRequired() + .HasColumnType("text"); - b.Property("Url") - .IsRequired() - .HasColumnType("text"); + b.Property("Url") + .IsRequired() + .HasColumnType("text"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("MergedById"); + b.HasIndex("MergedById"); - b.HasIndex("PrimaryRevisionInformationId") - .IsUnique(); + b.HasIndex("PrimaryRevisionInformationId") + .IsUnique(); - b.ToTable("TestMerges"); - }); + b.ToTable("TestMerges"); + }); - modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - - b.Property("AdministrationRights") - .HasColumnType("numeric(20,0)"); - - b.Property("CanonicalName") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("timestamp with time zone"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("Enabled") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("InstanceManagerRights") - .HasColumnType("numeric(20,0)"); - - b.Property("LastPasswordUpdate") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("SystemIdentifier") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("CanonicalName") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("SystemIdentifier") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("ChatSettings") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings") - .WithMany("Channels") - .HasForeignKey("ChatSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => - { - b.HasOne("Tgstation.Server.Host.Models.Job", "Job") - .WithOne() - .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") - .WithMany("CompileJobs") - .HasForeignKey("RevisionInformationId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithOne("DreamDaemonSettings") - .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithOne("DreamMakerSettings") - .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DualReattachInformation", b => - { - b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha") - .WithMany() - .HasForeignKey("AlphaId"); - - b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo") - .WithMany() - .HasForeignKey("BravoId"); - - b.HasOne("Tgstation.Server.Host.Models.Instance", null) - .WithOne("WatchdogReattachInformation") - .HasForeignKey("Tgstation.Server.Host.Models.DualReattachInformation", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("InstanceUsers") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Tgstation.Server.Host.Models.User", null) - .WithMany("InstanceUsers") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy") - .WithMany() - .HasForeignKey("CancelledById"); - - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("Jobs") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy") - .WithMany() - .HasForeignKey("StartedById") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob") - .WithMany() - .HasForeignKey("CompileJobId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithOne("RepositorySettings") - .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") - .WithMany("ActiveTestMerges") - .HasForeignKey("RevisionInformationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge") - .WithMany("RevisonInformations") - .HasForeignKey("TestMergeId") - .OnDelete(DeleteBehavior.ClientNoAction) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("RevisionInformations") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy") - .WithMany("TestMerges") - .HasForeignKey("MergedById") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation") - .WithOne("PrimaryTestMerge") - .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy") - .WithMany("CreatedUsers") - .HasForeignKey("CreatedById"); - }); + modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AdministrationRights") + .HasColumnType("numeric(20,0)"); + + b.Property("CanonicalName") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .IsRequired() + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedById") + .HasColumnType("bigint"); + + b.Property("Enabled") + .IsRequired() + .HasColumnType("boolean"); + + b.Property("InstanceManagerRights") + .HasColumnType("numeric(20,0)"); + + b.Property("LastPasswordUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(10000)") + .HasMaxLength(10000); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("SystemIdentifier") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CanonicalName") + .IsUnique(); + + b.HasIndex("CreatedById"); + + b.HasIndex("SystemIdentifier") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithMany("ChatSettings") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => + { + b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings") + .WithMany("Channels") + .HasForeignKey("ChatSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => + { + b.HasOne("Tgstation.Server.Host.Models.Job", "Job") + .WithOne() + .HasForeignKey("Tgstation.Server.Host.Models.CompileJob", "JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") + .WithMany("CompileJobs") + .HasForeignKey("RevisionInformationId") + .OnDelete(DeleteBehavior.ClientNoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithOne("DreamDaemonSettings") + .HasForeignKey("Tgstation.Server.Host.Models.DreamDaemonSettings", "InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithOne("DreamMakerSettings") + .HasForeignKey("Tgstation.Server.Host.Models.DreamMakerSettings", "InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.DualReattachInformation", b => + { + b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Alpha") + .WithMany() + .HasForeignKey("AlphaId"); + + b.HasOne("Tgstation.Server.Host.Models.ReattachInformation", "Bravo") + .WithMany() + .HasForeignKey("BravoId"); + + b.HasOne("Tgstation.Server.Host.Models.Instance", null) + .WithOne("WatchdogReattachInformation") + .HasForeignKey("Tgstation.Server.Host.Models.DualReattachInformation", "InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithMany("InstanceUsers") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Tgstation.Server.Host.Models.User", null) + .WithMany("InstanceUsers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => + { + b.HasOne("Tgstation.Server.Host.Models.User", "CancelledBy") + .WithMany() + .HasForeignKey("CancelledById"); + + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithMany("Jobs") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy") + .WithMany() + .HasForeignKey("StartedById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => + { + b.HasOne("Tgstation.Server.Host.Models.CompileJob", "CompileJob") + .WithMany() + .HasForeignKey("CompileJobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithOne("RepositorySettings") + .HasForeignKey("Tgstation.Server.Host.Models.RepositorySettings", "InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => + { + b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") + .WithMany("ActiveTestMerges") + .HasForeignKey("RevisionInformationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge") + .WithMany("RevisonInformations") + .HasForeignKey("TestMergeId") + .OnDelete(DeleteBehavior.ClientNoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => + { + b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") + .WithMany("RevisionInformations") + .HasForeignKey("InstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => + { + b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy") + .WithMany("TestMerges") + .HasForeignKey("MergedById") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation") + .WithOne("PrimaryTestMerge") + .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => + { + b.HasOne("Tgstation.Server.Host.Models.User", "CreatedBy") + .WithMany("CreatedUsers") + .HasForeignKey("CreatedById"); + }); #pragma warning restore 612, 618 - } - } + } + } }