From 749455ad516810f5ebc97996d61de07f22d79fa4 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 24 Nov 2020 16:44:40 -0500 Subject: [PATCH] Undo those shit migrations --- ...22231219_MSAddOAuthConnections.Designer.cs | 6 +- .../20201122231219_MSAddOAuthConnections.cs | 2 +- ...22231327_MYAddOAuthConnections.Designer.cs | 6 +- .../20201122231327_MYAddOAuthConnections.cs | 2 +- ...22231443_PGAddOAuthConnections.Designer.cs | 6 +- .../20201122231443_PGAddOAuthConnections.cs | 2 +- ...eOAuthExternalIdColumnToString.Designer.cs | 822 ------------------ ...4_MSChangeOAuthExternalIdColumnToString.cs | 41 - ...eOAuthExternalIdColumnToString.Designer.cs | 811 ----------------- ...2_MYChangeOAuthExternalIdColumnToString.cs | 41 - ...eOAuthExternalIdColumnToString.Designer.cs | 819 ----------------- ...5_PGChangeOAuthExternalIdColumnToString.cs | 41 - 12 files changed, 15 insertions(+), 2584 deletions(-) delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.Designer.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.Designer.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.Designer.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.cs diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.Designer.cs index 271369ebde..2a705bfa38 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.Designer.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.Designer.cs @@ -385,8 +385,10 @@ namespace Tgstation.Server.Host.Database.Migrations .HasColumnType("bigint") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ExternalUserId") - .HasColumnType("decimal(20,0)"); + b.Property("ExternalUserId") + .IsRequired() + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); b.Property("Provider") .HasColumnType("int"); diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.cs index e99c868e17..f965ae37de 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231219_MSAddOAuthConnections.cs @@ -21,7 +21,7 @@ namespace Tgstation.Server.Host.Database.Migrations Id = table.Column(nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Provider = table.Column(nullable: false), - ExternalUserId = table.Column(nullable: false), + ExternalUserId = table.Column(nullable: false, maxLength: 100), UserId = table.Column(nullable: true) }, constraints: table => diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.Designer.cs index 05e0d25108..9b2bac237d 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.Designer.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.Designer.cs @@ -381,8 +381,10 @@ namespace Tgstation.Server.Host.Database.Migrations .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("ExternalUserId") - .HasColumnType("bigint unsigned"); + b.Property("ExternalUserId") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); b.Property("Provider") .HasColumnType("int"); diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.cs index 422a4f98b8..d2741b785b 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231327_MYAddOAuthConnections.cs @@ -22,7 +22,7 @@ namespace Tgstation.Server.Host.Database.Migrations Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Provider = table.Column(nullable: false), - ExternalUserId = table.Column(nullable: false), + ExternalUserId = table.Column(nullable: false, maxLength: 100), UserId = table.Column(nullable: true) }, constraints: table => diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.Designer.cs index 9bbc1ecd6b..48cbdcf3a7 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.Designer.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.Designer.cs @@ -383,8 +383,10 @@ namespace Tgstation.Server.Host.Database.Migrations .HasColumnType("bigint") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ExternalUserId") - .HasColumnType("numeric(20,0)"); + b.Property("ExternalUserId") + .IsRequired() + .HasColumnType("character varying(100)") + .HasMaxLength(100); b.Property("Provider") .HasColumnType("integer"); diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.cs b/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.cs index 41c30fd23f..b660fe83e0 100644 --- a/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.cs +++ b/src/Tgstation.Server.Host/Database/Migrations/20201122231443_PGAddOAuthConnections.cs @@ -22,7 +22,7 @@ namespace Tgstation.Server.Host.Database.Migrations Id = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Provider = table.Column(nullable: false), - ExternalUserId = table.Column(nullable: false), + ExternalUserId = table.Column(nullable: false, maxLength: 100), UserId = table.Column(nullable: true) }, constraints: table => diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.Designer.cs deleted file mode 100644 index b129e448c0..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.Designer.cs +++ /dev/null @@ -1,822 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(SqlServerDatabaseContext))] - [Migration("20201124155144_MSChangeOAuthExternalIdColumnToString")] - partial class MSChangeOAuthExternalIdColumnToString - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.10") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ChannelLimit") - .HasColumnType("int"); - - b.Property("ConnectionString") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("Enabled") - .HasColumnType("bit"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("int"); - - b.Property("ReconnectionInterval") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ChatSettingsId") - .HasColumnType("bigint"); - - b.Property("DiscordChannelId") - .HasColumnType("decimal(20,0)"); - - b.Property("IrcChannel") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("bit"); - - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("bit"); - - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("bit"); - - b.Property("Tag") - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("ChatSettingsId", "DiscordChannelId") - .IsUnique() - .HasFilter("[DiscordChannelId] IS NOT NULL"); - - b.HasIndex("ChatSettingsId", "IrcChannel") - .IsUnique() - .HasFilter("[IrcChannel] IS NOT NULL"); - - b.ToTable("ChatChannels"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ByondVersion") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DMApiMajorVersion") - .HasColumnType("int"); - - b.Property("DMApiMinorVersion") - .HasColumnType("int"); - - b.Property("DMApiPatchVersion") - .HasColumnType("int"); - - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("uniqueidentifier"); - - b.Property("DmeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("GitHubDeploymentId") - .HasColumnType("int"); - - b.Property("GitHubRepoId") - .HasColumnType("bigint"); - - b.Property("JobId") - .HasColumnType("bigint"); - - b.Property("MinimumSecurityLevel") - .HasColumnType("int"); - - b.Property("Output") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("RevisionInformationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DirectoryName"); - - b.HasIndex("JobId") - .IsUnique(); - - b.HasIndex("RevisionInformationId"); - - b.ToTable("CompileJobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AdditionalParameters") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("bit"); - - b.Property("AutoStart") - .IsRequired() - .HasColumnType("bit"); - - b.Property("HeartbeatSeconds") - .HasColumnType("bigint"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Port") - .HasColumnType("int"); - - b.Property("SecurityLevel") - .HasColumnType("int"); - - b.Property("StartupTimeout") - .HasColumnType("bigint"); - - b.Property("TopicRequestTimeout") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ApiValidationPort") - .HasColumnType("int"); - - b.Property("ApiValidationSecurityLevel") - .HasColumnType("int"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("ProjectName") - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("RequireDMApiValidation") - .IsRequired() - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AutoUpdateInterval") - .HasColumnType("bigint"); - - b.Property("ChatBotLimit") - .HasColumnType("int"); - - b.Property("ConfigurationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired() - .HasColumnType("bit"); - - b.Property("Path") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Path") - .IsUnique(); - - b.ToTable("Instances"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ByondRights") - .HasColumnType("decimal(20,0)"); - - b.Property("ChatBotRights") - .HasColumnType("decimal(20,0)"); - - b.Property("ConfigurationRights") - .HasColumnType("decimal(20,0)"); - - b.Property("DreamDaemonRights") - .HasColumnType("decimal(20,0)"); - - b.Property("DreamMakerRights") - .HasColumnType("decimal(20,0)"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("InstanceUserRights") - .HasColumnType("decimal(20,0)"); - - b.Property("RepositoryRights") - .HasColumnType("decimal(20,0)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId"); - - b.HasIndex("UserId", "InstanceId") - .IsUnique(); - - b.ToTable("InstanceUsers"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CancelRight") - .HasColumnType("decimal(20,0)"); - - b.Property("CancelRightsType") - .HasColumnType("decimal(20,0)"); - - b.Property("Cancelled") - .IsRequired() - .HasColumnType("bit"); - - b.Property("CancelledById") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ErrorCode") - .HasColumnType("bigint"); - - b.Property("ExceptionDetails") - .HasColumnType("nvarchar(max)"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("datetimeoffset"); - - b.Property("StartedById") - .HasColumnType("bigint"); - - b.Property("StoppedAt") - .HasColumnType("datetimeoffset"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.OAuthConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ExternalUserId") - .IsRequired() - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("Provider", "ExternalUserId") - .IsUnique(); - - b.ToTable("OAuthConnections"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AccessIdentifier") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CompileJobId") - .HasColumnType("bigint"); - - b.Property("LaunchSecurityLevel") - .HasColumnType("int"); - - b.Property("Port") - .HasColumnType("int"); - - b.Property("ProcessId") - .HasColumnType("int"); - - b.Property("RebootState") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CompileJobId"); - - b.ToTable("ReattachInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AccessToken") - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("AccessUser") - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("bit"); - - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("bit"); - - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("CreateGitHubDeployments") - .IsRequired() - .HasColumnType("bit"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("bit"); - - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("bit"); - - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("RevisionInformationId") - .HasColumnType("bigint"); - - b.Property("TestMergeId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RevisionInformationId"); - - b.HasIndex("TestMergeId"); - - b.ToTable("RevInfoTestMerges"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CommitSha") - .IsRequired() - .HasColumnType("nvarchar(40)") - .HasMaxLength(40); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("nvarchar(40)") - .HasMaxLength(40); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "CommitSha") - .IsUnique(); - - b.ToTable("RevisionInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Author") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("BodyAtMerge") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Comment") - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("MergedAt") - .HasColumnType("datetimeoffset"); - - b.Property("MergedById") - .HasColumnType("bigint"); - - b.Property("Number") - .HasColumnType("int"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("bigint"); - - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("nvarchar(40)") - .HasMaxLength(40); - - b.Property("TitleAtMerge") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Url") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("MergedById"); - - b.HasIndex("PrimaryRevisionInformationId") - .IsUnique(); - - b.ToTable("TestMerges"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AdministrationRights") - .HasColumnType("decimal(20,0)"); - - b.Property("CanonicalName") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("datetimeoffset"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("Enabled") - .IsRequired() - .HasColumnType("bit"); - - b.Property("InstanceManagerRights") - .HasColumnType("decimal(20,0)"); - - b.Property("LastPasswordUpdate") - .HasColumnType("datetimeoffset"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(10000); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("SystemIdentifier") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CanonicalName") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("SystemIdentifier") - .IsUnique() - .HasFilter("[SystemIdentifier] IS NOT NULL"); - - 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.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.OAuthConnection", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "User") - .WithMany("OAuthConnections") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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 - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.cs deleted file mode 100644 index dff0936983..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155144_MSChangeOAuthExternalIdColumnToString.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Tgstation.Server.Host.Database.Migrations -{ - /// - /// Changes the OAuthConnections ExternalUserId column to a string for MSSQL. - /// - public partial class MSChangeOAuthExternalIdColumnToString : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - maxLength: 100, - nullable: false, - oldClrType: typeof(decimal), - oldType: "decimal(20,0)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - type: "decimal(20,0)", - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 100); - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.Designer.cs deleted file mode 100644 index ffbf808040..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.Designer.cs +++ /dev/null @@ -1,811 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(MySqlDatabaseContext))] - [Migration("20201124155232_MYChangeOAuthExternalIdColumnToString")] - partial class MYChangeOAuthExternalIdColumnToString - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ChannelLimit") - .IsRequired() - .HasColumnType("smallint unsigned"); - - b.Property("ConnectionString") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("Enabled") - .HasColumnType("tinyint(1)"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(100) CHARACTER SET utf8mb4") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("int"); - - b.Property("ReconnectionInterval") - .IsRequired() - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ChatSettingsId") - .HasColumnType("bigint"); - - b.Property("DiscordChannelId") - .HasColumnType("bigint unsigned"); - - b.Property("IrcChannel") - .HasColumnType("varchar(100) CHARACTER SET utf8mb4") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("Tag") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("ChatSettingsId", "DiscordChannelId") - .IsUnique(); - - b.HasIndex("ChatSettingsId", "IrcChannel") - .IsUnique(); - - b.ToTable("ChatChannels"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.CompileJob", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ByondVersion") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("DMApiMajorVersion") - .HasColumnType("int"); - - b.Property("DMApiMinorVersion") - .HasColumnType("int"); - - b.Property("DMApiPatchVersion") - .HasColumnType("int"); - - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("char(36)"); - - b.Property("DmeName") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("GitHubDeploymentId") - .HasColumnType("int"); - - b.Property("GitHubRepoId") - .HasColumnType("bigint"); - - b.Property("JobId") - .HasColumnType("bigint"); - - b.Property("MinimumSecurityLevel") - .HasColumnType("int"); - - b.Property("Output") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("RevisionInformationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DirectoryName"); - - b.HasIndex("JobId") - .IsUnique(); - - b.HasIndex("RevisionInformationId"); - - b.ToTable("CompileJobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("AdditionalParameters") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("AutoStart") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("HeartbeatSeconds") - .IsRequired() - .HasColumnType("int unsigned"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Port") - .IsRequired() - .HasColumnType("smallint unsigned"); - - b.Property("SecurityLevel") - .HasColumnType("int"); - - b.Property("StartupTimeout") - .IsRequired() - .HasColumnType("int unsigned"); - - b.Property("TopicRequestTimeout") - .IsRequired() - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ApiValidationPort") - .IsRequired() - .HasColumnType("smallint unsigned"); - - b.Property("ApiValidationSecurityLevel") - .HasColumnType("int"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("ProjectName") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("RequireDMApiValidation") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("AutoUpdateInterval") - .IsRequired() - .HasColumnType("int unsigned"); - - b.Property("ChatBotLimit") - .IsRequired() - .HasColumnType("smallint unsigned"); - - b.Property("ConfigurationType") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("Path") - .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); - - b.HasKey("Id"); - - b.HasIndex("Path") - .IsUnique(); - - b.ToTable("Instances"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ByondRights") - .HasColumnType("bigint unsigned"); - - b.Property("ChatBotRights") - .HasColumnType("bigint unsigned"); - - b.Property("ConfigurationRights") - .HasColumnType("bigint unsigned"); - - b.Property("DreamDaemonRights") - .HasColumnType("bigint unsigned"); - - b.Property("DreamMakerRights") - .HasColumnType("bigint unsigned"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("InstanceUserRights") - .HasColumnType("bigint unsigned"); - - b.Property("RepositoryRights") - .HasColumnType("bigint unsigned"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId"); - - b.HasIndex("UserId", "InstanceId") - .IsUnique(); - - b.ToTable("InstanceUsers"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CancelRight") - .HasColumnType("bigint unsigned"); - - b.Property("CancelRightsType") - .HasColumnType("bigint unsigned"); - - b.Property("Cancelled") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("CancelledById") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("ErrorCode") - .HasColumnType("int unsigned"); - - b.Property("ExceptionDetails") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("datetime(6)"); - - b.Property("StartedById") - .HasColumnType("bigint"); - - b.Property("StoppedAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.OAuthConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("ExternalUserId") - .IsRequired() - .HasColumnType("varchar(100) CHARACTER SET utf8mb4") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("Provider", "ExternalUserId") - .IsUnique(); - - b.ToTable("OAuthConnections"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("AccessIdentifier") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("CompileJobId") - .HasColumnType("bigint"); - - b.Property("LaunchSecurityLevel") - .HasColumnType("int"); - - b.Property("Port") - .HasColumnType("smallint unsigned"); - - b.Property("ProcessId") - .HasColumnType("int"); - - b.Property("RebootState") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CompileJobId"); - - b.ToTable("ReattachInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("AccessToken") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("AccessUser") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("CreateGitHubDeployments") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("RevisionInformationId") - .HasColumnType("bigint"); - - b.Property("TestMergeId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RevisionInformationId"); - - b.HasIndex("TestMergeId"); - - b.ToTable("RevInfoTestMerges"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CommitSha") - .IsRequired() - .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "CommitSha") - .IsUnique(); - - b.ToTable("RevisionInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("Author") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("BodyAtMerge") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Comment") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("MergedAt") - .HasColumnType("datetime(6)"); - - b.Property("MergedById") - .HasColumnType("bigint"); - - b.Property("Number") - .HasColumnType("int"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("bigint"); - - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("varchar(40) CHARACTER SET utf8mb4") - .HasMaxLength(40); - - b.Property("TitleAtMerge") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("Url") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.HasKey("Id"); - - b.HasIndex("MergedById"); - - b.HasIndex("PrimaryRevisionInformationId") - .IsUnique(); - - b.ToTable("TestMerges"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("AdministrationRights") - .HasColumnType("bigint unsigned"); - - b.Property("CanonicalName") - .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("datetime(6)"); - - b.Property("CreatedById") - .HasColumnType("bigint"); - - b.Property("Enabled") - .IsRequired() - .HasColumnType("tinyint(1)"); - - b.Property("InstanceManagerRights") - .HasColumnType("bigint unsigned"); - - b.Property("LastPasswordUpdate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(10000); - - b.Property("PasswordHash") - .HasColumnType("longtext CHARACTER SET utf8mb4"); - - b.Property("SystemIdentifier") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); - - 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.Cascade) - .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.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.OAuthConnection", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "User") - .WithMany("OAuthConnections") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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 - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.cs deleted file mode 100644 index 7af7221c98..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155232_MYChangeOAuthExternalIdColumnToString.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Tgstation.Server.Host.Database.Migrations -{ - /// - /// Changes the OAuthConnections ExternalUserId column to a string for MYSQL. - /// - public partial class MYChangeOAuthExternalIdColumnToString : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - maxLength: 100, - nullable: false, - oldClrType: typeof(ulong), - oldType: "bigint unsigned"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - type: "bigint unsigned", - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 100); - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.Designer.cs deleted file mode 100644 index 89f3c0de84..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.Designer.cs +++ /dev/null @@ -1,819 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(PostgresSqlDatabaseContext))] - [Migration("20201124155325_PGChangeOAuthExternalIdColumnToString")] - partial class PGChangeOAuthExternalIdColumnToString - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) - .HasAnnotation("ProductVersion", "3.1.10") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - 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("ConnectionString") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasColumnType("character varying(100)") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("integer"); - - b.Property("ReconnectionInterval") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - 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("DiscordChannelId") - .HasColumnType("numeric(20,0)"); - - b.Property("IrcChannel") - .HasColumnType("character varying(100)") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("Tag") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("ChatSettingsId", "DiscordChannelId") - .IsUnique(); - - b.HasIndex("ChatSettingsId", "IrcChannel") - .IsUnique(); - - b.ToTable("ChatChannels"); - }); - - 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("DMApiMajorVersion") - .HasColumnType("integer"); - - b.Property("DMApiMinorVersion") - .HasColumnType("integer"); - - b.Property("DMApiPatchVersion") - .HasColumnType("integer"); - - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("uuid"); - - b.Property("DmeName") - .IsRequired() - .HasColumnType("text"); - - b.Property("GitHubDeploymentId") - .HasColumnType("integer"); - - b.Property("GitHubRepoId") - .HasColumnType("bigint"); - - b.Property("JobId") - .HasColumnType("bigint"); - - b.Property("MinimumSecurityLevel") - .HasColumnType("integer"); - - b.Property("Output") - .IsRequired() - .HasColumnType("text"); - - b.Property("RevisionInformationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("DirectoryName"); - - b.HasIndex("JobId") - .IsUnique(); - - b.HasIndex("RevisionInformationId"); - - b.ToTable("CompileJobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamDaemonSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - - b.Property("AdditionalParameters") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("AutoStart") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("HeartbeatSeconds") - .HasColumnType("bigint"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("SecurityLevel") - .HasColumnType("integer"); - - b.Property("StartupTimeout") - .HasColumnType("bigint"); - - b.Property("TopicRequestTimeout") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - 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("ApiValidationSecurityLevel") - .HasColumnType("integer"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("ProjectName") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("RequireDMApiValidation") - .IsRequired() - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - 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("ChatBotLimit") - .HasColumnType("integer"); - - b.Property("ConfigurationType") - .HasColumnType("integer"); - - b.Property("Name") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Path") - .IsUnique(); - - b.ToTable("Instances"); - }); - - 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("ChatBotRights") - .HasColumnType("numeric(20,0)"); - - b.Property("ConfigurationRights") - .HasColumnType("numeric(20,0)"); - - b.Property("DreamDaemonRights") - .HasColumnType("numeric(20,0)"); - - b.Property("DreamMakerRights") - .HasColumnType("numeric(20,0)"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("InstanceUserRights") - .HasColumnType("numeric(20,0)"); - - b.Property("RepositoryRights") - .HasColumnType("numeric(20,0)"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId"); - - b.HasIndex("UserId", "InstanceId") - .IsUnique(); - - b.ToTable("InstanceUsers"); - }); - - 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("CancelRightsType") - .HasColumnType("numeric(20,0)"); - - b.Property("Cancelled") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("CancelledById") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("ErrorCode") - .HasColumnType("bigint"); - - b.Property("ExceptionDetails") - .HasColumnType("text"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("timestamp with time zone"); - - b.Property("StartedById") - .HasColumnType("bigint"); - - b.Property("StoppedAt") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.OAuthConnection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - - b.Property("ExternalUserId") - .IsRequired() - .HasColumnType("character varying(100)") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("integer"); - - b.Property("UserId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("Provider", "ExternalUserId") - .IsUnique(); - - b.ToTable("OAuthConnections"); - }); - - 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("CompileJobId") - .HasColumnType("bigint"); - - b.Property("LaunchSecurityLevel") - .HasColumnType("integer"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("ProcessId") - .HasColumnType("integer"); - - b.Property("RebootState") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("CompileJobId"); - - b.ToTable("ReattachInformations"); - }); - - 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("AccessUser") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("CreateGitHubDeployments") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("InstanceId") - .HasColumnType("bigint"); - - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("boolean"); - - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - 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("TestMergeId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("RevisionInformationId"); - - b.HasIndex("TestMergeId"); - - b.ToTable("RevInfoTestMerges"); - }); - - 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("InstanceId") - .HasColumnType("bigint"); - - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("character varying(40)") - .HasMaxLength(40); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "CommitSha") - .IsUnique(); - - b.ToTable("RevisionInformations"); - }); - - 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("BodyAtMerge") - .IsRequired() - .HasColumnType("text"); - - b.Property("Comment") - .HasColumnType("character varying(10000)") - .HasMaxLength(10000); - - b.Property("MergedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("MergedById") - .HasColumnType("bigint"); - - b.Property("Number") - .HasColumnType("integer"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("bigint"); - - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("character varying(40)") - .HasMaxLength(40); - - b.Property("TitleAtMerge") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("MergedById"); - - b.HasIndex("PrimaryRevisionInformationId") - .IsUnique(); - - 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.Cascade) - .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.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.OAuthConnection", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "User") - .WithMany("OAuthConnections") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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 - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.cs b/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.cs deleted file mode 100644 index 9be6a9fab5..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20201124155325_PGChangeOAuthExternalIdColumnToString.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Tgstation.Server.Host.Database.Migrations -{ - /// - /// Changes the OAuthConnections ExternalUserId column to a string for PostgreSQL. - /// - public partial class PGChangeOAuthExternalIdColumnToString : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - maxLength: 100, - nullable: false, - oldClrType: typeof(decimal), - oldType: "numeric(20,0)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.AlterColumn( - name: "ExternalUserId", - table: "OAuthConnections", - type: "numeric(20,0)", - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 100); - } - } -}