From a899103727b139df02fca37d2fcbd00b71a06dca Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Thu, 23 Apr 2020 01:13:04 -0400 Subject: [PATCH] Nuke Sqlite migrations --- ...27_SLAddCompileJobDMApiVersion.Designer.cs | 671 -------------- ...00422011927_SLAddCompileJobDMApiVersion.cs | 62 -- .../20200423010708_SLAddSqlite.Designer.cs | 814 ----------------- .../Migrations/20200423010708_SLAddSqlite.cs | 644 -------------- .../SqliteDatabaseContextModelSnapshot.cs | 815 ------------------ 5 files changed, 3006 deletions(-) delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.Designer.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.Designer.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.cs delete mode 100644 src/Tgstation.Server.Host/Database/Migrations/SqliteDatabaseContextModelSnapshot.cs diff --git a/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.Designer.cs deleted file mode 100644 index 6154815471..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.Designer.cs +++ /dev/null @@ -1,671 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(SqliteDatabaseContext))] - [Migration("20200422011927_SLAddCompileJobDMApiVersion")] - partial class SLAddCompileJobDMApiVersion - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.2.6-servicing-10079"); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConnectionString") - .IsRequired() - .HasMaxLength(10000); - - b.Property("Enabled"); - - b.Property("InstanceId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100); - - b.Property("Provider"); - - b.Property("ReconnectionInterval") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ChatSettingsId"); - - b.Property("DiscordChannelId"); - - b.Property("IrcChannel") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired(); - - b.Property("IsUpdatesChannel") - .IsRequired(); - - b.Property("IsWatchdogChannel") - .IsRequired(); - - b.Property("Tag") - .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(); - - b.Property("ByondVersion") - .IsRequired(); - - b.Property("DMApiMajorVersion"); - - b.Property("DMApiMinorVersion"); - - b.Property("DMApiPatchVersion"); - - b.Property("DirectoryName") - .IsRequired(); - - b.Property("DmeName") - .IsRequired(); - - b.Property("JobId"); - - b.Property("MinimumSecurityLevel"); - - b.Property("Output") - .IsRequired(); - - b.Property("RevisionInformationId"); - - 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(); - - b.Property("AccessToken"); - - b.Property("AllowWebClient") - .IsRequired(); - - b.Property("AutoStart") - .IsRequired(); - - b.Property("InstanceId"); - - b.Property("PrimaryPort") - .IsRequired(); - - b.Property("ProcessId"); - - b.Property("SecondaryPort") - .IsRequired(); - - b.Property("SecurityLevel"); - - b.Property("SoftRestart") - .IsRequired(); - - b.Property("SoftShutdown") - .IsRequired(); - - b.Property("StartupTimeout") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApiValidationPort") - .IsRequired(); - - b.Property("ApiValidationSecurityLevel"); - - b.Property("InstanceId"); - - b.Property("ProjectName") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AutoUpdateInterval") - .IsRequired(); - - b.Property("ConfigurationType"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired(); - - b.Property("Path") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("Path") - .IsUnique(); - - b.ToTable("Instances"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ByondRights"); - - b.Property("ChatBotRights"); - - b.Property("ConfigurationRights"); - - b.Property("DreamDaemonRights"); - - b.Property("DreamMakerRights"); - - b.Property("InstanceId"); - - b.Property("InstanceUserRights"); - - b.Property("RepositoryRights"); - - b.Property("UserId") - .IsRequired(); - - 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(); - - b.Property("CancelRight"); - - b.Property("CancelRightsType"); - - b.Property("Cancelled") - .IsRequired(); - - b.Property("CancelledById"); - - b.Property("Description") - .IsRequired(); - - b.Property("ExceptionDetails"); - - b.Property("InstanceId"); - - b.Property("StartedAt") - .IsRequired(); - - b.Property("StartedById") - .IsRequired(); - - b.Property("StoppedAt"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessIdentifier") - .IsRequired(); - - b.Property("ChatChannelsJson") - .IsRequired(); - - b.Property("ChatCommandsJson") - .IsRequired(); - - b.Property("CompileJobId"); - - b.Property("IsPrimary"); - - b.Property("Port"); - - b.Property("ProcessId"); - - b.Property("RebootState"); - - b.HasKey("Id"); - - b.HasIndex("CompileJobId"); - - b.ToTable("ReattachInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessToken") - .HasMaxLength(10000); - - b.Property("AccessUser") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired(); - - b.Property("AutoUpdatesSynchronize") - .IsRequired(); - - b.Property("CommitterEmail") - .IsRequired() - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasMaxLength(10000); - - b.Property("InstanceId"); - - b.Property("PostTestMergeComment") - .IsRequired(); - - b.Property("PushTestMergeCommits") - .IsRequired(); - - b.Property("ShowTestMergeCommitters") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("RevisionInformationId"); - - b.Property("TestMergeId"); - - b.HasKey("Id"); - - b.HasIndex("RevisionInformationId"); - - b.HasIndex("TestMergeId"); - - b.ToTable("RevInfoTestMerges"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("CommitSha") - .IsRequired() - .HasMaxLength(40); - - b.Property("InstanceId"); - - b.Property("OriginCommitSha") - .IsRequired() - .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(); - - b.Property("Author") - .IsRequired(); - - b.Property("BodyAtMerge") - .IsRequired(); - - b.Property("Comment") - .HasMaxLength(10000); - - b.Property("MergedAt"); - - b.Property("MergedById") - .IsRequired(); - - b.Property("Number"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired(); - - b.Property("PullRequestRevision") - .IsRequired() - .HasMaxLength(40); - - b.Property("TitleAtMerge") - .IsRequired(); - - b.Property("Url") - .IsRequired(); - - 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(); - - b.Property("AdministrationRights"); - - b.Property("CanonicalName") - .IsRequired(); - - b.Property("CreatedAt") - .IsRequired(); - - b.Property("CreatedById"); - - b.Property("Enabled") - .IsRequired(); - - b.Property("InstanceManagerRights"); - - b.Property("LastPasswordUpdate"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(10000); - - b.Property("PasswordHash"); - - b.Property("SystemIdentifier"); - - b.HasKey("Id"); - - b.HasIndex("CanonicalName") - .IsUnique(); - - b.HasIndex("CreatedById"); - - b.HasIndex("SystemIdentifier") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.WatchdogReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AlphaId"); - - b.Property("AlphaIsActive"); - - b.Property("BravoId"); - - b.Property("InstanceId"); - - b.HasKey("Id"); - - b.HasIndex("AlphaId"); - - b.HasIndex("BravoId"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("WatchdogReattachInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("ChatSettings") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.HasOne("Tgstation.Server.Host.Models.ChatBot", "ChatSettings") - .WithMany("Channels") - .HasForeignKey("ChatSettingsId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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.Restrict); - - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") - .WithMany("CompileJobs") - .HasForeignKey("RevisionInformationId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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); - }); - - 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); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.InstanceUser", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("InstanceUsers") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Tgstation.Server.Host.Models.User") - .WithMany("InstanceUsers") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - 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); - - b.HasOne("Tgstation.Server.Host.Models.User", "StartedBy") - .WithMany() - .HasForeignKey("StartedById") - .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); - }); - - 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); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "RevisionInformation") - .WithMany("ActiveTestMerges") - .HasForeignKey("RevisionInformationId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Tgstation.Server.Host.Models.TestMerge", "TestMerge") - .WithMany("RevisonInformations") - .HasForeignKey("TestMergeId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevisionInformation", b => - { - b.HasOne("Tgstation.Server.Host.Models.Instance", "Instance") - .WithMany("RevisionInformations") - .HasForeignKey("InstanceId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.TestMerge", b => - { - b.HasOne("Tgstation.Server.Host.Models.User", "MergedBy") - .WithMany("TestMerges") - .HasForeignKey("MergedById") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Tgstation.Server.Host.Models.RevisionInformation", "PrimaryRevisionInformation") - .WithOne("PrimaryTestMerge") - .HasForeignKey("Tgstation.Server.Host.Models.TestMerge", "PrimaryRevisionInformationId") - .OnDelete(DeleteBehavior.Restrict); - }); - - 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.WatchdogReattachInformation", 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") - .WithOne("WatchdogReattachInformation") - .HasForeignKey("Tgstation.Server.Host.Models.WatchdogReattachInformation", "InstanceId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.cs b/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.cs deleted file mode 100644 index b8c66c4155..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20200422011927_SLAddCompileJobDMApiVersion.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Tgstation.Server.Host.Database.Migrations -{ - /// - /// Add fields for the property for SQLite. - /// - public partial class SLAddCompileJobDMApiVersion : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.DropColumn( - name: "ServerCommandsJson", - table: "ReattachInformations"); - - migrationBuilder.AddColumn( - name: "DMApiMajorVersion", - table: "CompileJobs", - nullable: true); - - migrationBuilder.AddColumn( - name: "DMApiMinorVersion", - table: "CompileJobs", - nullable: true); - - migrationBuilder.AddColumn( - name: "DMApiPatchVersion", - table: "CompileJobs", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.DropColumn( - name: "DMApiMajorVersion", - table: "CompileJobs"); - - migrationBuilder.DropColumn( - name: "DMApiMinorVersion", - table: "CompileJobs"); - - migrationBuilder.DropColumn( - name: "DMApiPatchVersion", - table: "CompileJobs"); - - migrationBuilder.AddColumn( - name: "ServerCommandsJson", - table: "ReattachInformations", - nullable: false, - defaultValue: "server_commands.json"); - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.Designer.cs b/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.Designer.cs deleted file mode 100644 index 58a4df3724..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.Designer.cs +++ /dev/null @@ -1,814 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(SqliteDatabaseContext))] - [Migration("20200423010708_SLAddSqlite")] - partial class SLAddSqlite - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.3"); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelLimit") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ConnectionString") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("INTEGER"); - - b.Property("ReconnectionInterval") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChatSettingsId") - .HasColumnType("INTEGER"); - - b.Property("DiscordChannelId") - .HasColumnType("INTEGER"); - - b.Property("IrcChannel") - .HasColumnType("TEXT") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("Tag") - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("ByondVersion") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DmeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("JobId") - .HasColumnType("INTEGER"); - - b.Property("MinimumSecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("Output") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("RevisionInformationId") - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("AccessToken") - .HasColumnType("TEXT"); - - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("AutoStart") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("PrimaryPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ProcessId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("SecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("SoftRestart") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("SoftShutdown") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("StartupTimeout") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ApiValidationPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ApiValidationSecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("ProjectName") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoUpdateInterval") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ChatBotLimit") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ConfigurationType") - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired() - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("ByondRights") - .HasColumnType("INTEGER"); - - b.Property("ChatBotRights") - .HasColumnType("INTEGER"); - - b.Property("ConfigurationRights") - .HasColumnType("INTEGER"); - - b.Property("DreamDaemonRights") - .HasColumnType("INTEGER"); - - b.Property("DreamMakerRights") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("InstanceUserRights") - .HasColumnType("INTEGER"); - - b.Property("RepositoryRights") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("CancelRight") - .HasColumnType("INTEGER"); - - b.Property("CancelRightsType") - .HasColumnType("INTEGER"); - - b.Property("Cancelled") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("CancelledById") - .HasColumnType("INTEGER"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExceptionDetails") - .HasColumnType("TEXT"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("StartedById") - .HasColumnType("INTEGER"); - - b.Property("StoppedAt") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AccessIdentifier") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ChatChannelsJson") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ChatCommandsJson") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CompileJobId") - .HasColumnType("INTEGER"); - - b.Property("IsPrimary") - .HasColumnType("INTEGER"); - - b.Property("Port") - .HasColumnType("INTEGER"); - - b.Property("ProcessId") - .HasColumnType("INTEGER"); - - b.Property("RebootState") - .HasColumnType("INTEGER"); - - b.Property("ServerCommandsJson") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CompileJobId"); - - b.ToTable("ReattachInformations"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RepositorySettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AccessToken") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("AccessUser") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("RevisionInformationId") - .HasColumnType("INTEGER"); - - b.Property("TestMergeId") - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("CommitSha") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(40); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("Author") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("BodyAtMerge") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Comment") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("MergedAt") - .HasColumnType("TEXT"); - - b.Property("MergedById") - .HasColumnType("INTEGER"); - - b.Property("Number") - .HasColumnType("INTEGER"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("AdministrationRights") - .HasColumnType("INTEGER"); - - b.Property("CanonicalName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CreatedById") - .HasColumnType("INTEGER"); - - b.Property("Enabled") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("InstanceManagerRights") - .HasColumnType("INTEGER"); - - b.Property("LastPasswordUpdate") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .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.WatchdogReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AlphaId") - .HasColumnType("INTEGER"); - - b.Property("AlphaIsActive") - .HasColumnType("INTEGER"); - - b.Property("BravoId") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AlphaId"); - - b.HasIndex("BravoId"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("WatchdogReattachInformations"); - }); - - 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.Restrict) - .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.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.Cascade) - .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.Restrict) - .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.WatchdogReattachInformation", 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.WatchdogReattachInformation", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.cs b/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.cs deleted file mode 100644 index b288f9c9d1..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/20200423010708_SLAddSqlite.cs +++ /dev/null @@ -1,644 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -// No way to solve these -#pragma warning disable CA1502 -#pragma warning disable CA1506 - -namespace Tgstation.Server.Host.Database.Migrations -{ - /// - /// Initial migration for SQLite. - /// - public partial class SLAddSqlite : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.CreateTable( - name: "Instances", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(maxLength: 10000, nullable: false), - Path = table.Column(nullable: false), - Online = table.Column(nullable: false), - ConfigurationType = table.Column(nullable: false), - AutoUpdateInterval = table.Column(nullable: false), - ChatBotLimit = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Instances", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Enabled = table.Column(nullable: false), - CreatedAt = table.Column(nullable: false), - SystemIdentifier = table.Column(nullable: true), - Name = table.Column(maxLength: 10000, nullable: false), - AdministrationRights = table.Column(nullable: false), - InstanceManagerRights = table.Column(nullable: false), - PasswordHash = table.Column(nullable: true), - CreatedById = table.Column(nullable: true), - CanonicalName = table.Column(nullable: false), - LastPasswordUpdate = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - table.ForeignKey( - name: "FK_Users_Users_CreatedById", - column: x => x.CreatedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ChatBots", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(maxLength: 100, nullable: false), - Enabled = table.Column(nullable: true), - ReconnectionInterval = table.Column(nullable: false), - ChannelLimit = table.Column(nullable: false), - Provider = table.Column(nullable: false), - ConnectionString = table.Column(maxLength: 10000, nullable: false), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ChatBots", x => x.Id); - table.ForeignKey( - name: "FK_ChatBots_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "DreamDaemonSettings", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - AllowWebClient = table.Column(nullable: false), - SecurityLevel = table.Column(nullable: false), - PrimaryPort = table.Column(nullable: false), - SecondaryPort = table.Column(nullable: false), - StartupTimeout = table.Column(nullable: false), - AutoStart = table.Column(nullable: false), - SoftRestart = table.Column(nullable: false), - SoftShutdown = table.Column(nullable: false), - ProcessId = table.Column(nullable: true), - AccessToken = table.Column(nullable: true), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DreamDaemonSettings", x => x.Id); - table.ForeignKey( - name: "FK_DreamDaemonSettings_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "DreamMakerSettings", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - ProjectName = table.Column(maxLength: 10000, nullable: true), - ApiValidationPort = table.Column(nullable: false), - ApiValidationSecurityLevel = table.Column(nullable: false), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DreamMakerSettings", x => x.Id); - table.ForeignKey( - name: "FK_DreamMakerSettings_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "RepositorySettings", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - CommitterName = table.Column(maxLength: 10000, nullable: false), - CommitterEmail = table.Column(maxLength: 10000, nullable: false), - AccessUser = table.Column(maxLength: 10000, nullable: true), - AccessToken = table.Column(maxLength: 10000, nullable: true), - PushTestMergeCommits = table.Column(nullable: false), - ShowTestMergeCommitters = table.Column(nullable: false), - AutoUpdatesKeepTestMerges = table.Column(nullable: false), - AutoUpdatesSynchronize = table.Column(nullable: false), - PostTestMergeComment = table.Column(nullable: false), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RepositorySettings", x => x.Id); - table.ForeignKey( - name: "FK_RepositorySettings_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "RevisionInformations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - CommitSha = table.Column(maxLength: 40, nullable: false), - OriginCommitSha = table.Column(maxLength: 40, nullable: false), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RevisionInformations", x => x.Id); - table.ForeignKey( - name: "FK_RevisionInformations_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "InstanceUsers", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column(nullable: false), - InstanceUserRights = table.Column(nullable: false), - ByondRights = table.Column(nullable: false), - DreamDaemonRights = table.Column(nullable: false), - DreamMakerRights = table.Column(nullable: false), - RepositoryRights = table.Column(nullable: false), - ChatBotRights = table.Column(nullable: false), - ConfigurationRights = table.Column(nullable: false), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_InstanceUsers", x => x.Id); - table.ForeignKey( - name: "FK_InstanceUsers_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_InstanceUsers_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Jobs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Description = table.Column(nullable: false), - ExceptionDetails = table.Column(nullable: true), - StartedAt = table.Column(nullable: false), - StoppedAt = table.Column(nullable: true), - Cancelled = table.Column(nullable: false), - CancelRightsType = table.Column(nullable: true), - CancelRight = table.Column(nullable: true), - StartedById = table.Column(nullable: false), - CancelledById = table.Column(nullable: true), - InstanceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Jobs", x => x.Id); - table.ForeignKey( - name: "FK_Jobs_Users_CancelledById", - column: x => x.CancelledById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Jobs_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Jobs_Users_StartedById", - column: x => x.StartedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ChatChannels", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - IrcChannel = table.Column(maxLength: 100, nullable: true), - DiscordChannelId = table.Column(nullable: true), - IsAdminChannel = table.Column(nullable: false), - IsWatchdogChannel = table.Column(nullable: false), - IsUpdatesChannel = table.Column(nullable: false), - Tag = table.Column(maxLength: 10000, nullable: true), - ChatSettingsId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ChatChannels", x => x.Id); - table.ForeignKey( - name: "FK_ChatChannels_ChatBots_ChatSettingsId", - column: x => x.ChatSettingsId, - principalTable: "ChatBots", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "TestMerges", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Number = table.Column(nullable: false), - PullRequestRevision = table.Column(maxLength: 40, nullable: false), - Comment = table.Column(maxLength: 10000, nullable: true), - TitleAtMerge = table.Column(nullable: false), - BodyAtMerge = table.Column(nullable: false), - Url = table.Column(nullable: false), - Author = table.Column(nullable: false), - MergedAt = table.Column(nullable: false), - MergedById = table.Column(nullable: false), - PrimaryRevisionInformationId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TestMerges", x => x.Id); - table.ForeignKey( - name: "FK_TestMerges_Users_MergedById", - column: x => x.MergedById, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_TestMerges_RevisionInformations_PrimaryRevisionInformationId", - column: x => x.PrimaryRevisionInformationId, - principalTable: "RevisionInformations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "CompileJobs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DmeName = table.Column(nullable: false), - Output = table.Column(nullable: false), - DirectoryName = table.Column(nullable: false), - MinimumSecurityLevel = table.Column(nullable: false), - JobId = table.Column(nullable: false), - RevisionInformationId = table.Column(nullable: false), - ByondVersion = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CompileJobs", x => x.Id); - table.ForeignKey( - name: "FK_CompileJobs_Jobs_JobId", - column: x => x.JobId, - principalTable: "Jobs", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_CompileJobs_RevisionInformations_RevisionInformationId", - column: x => x.RevisionInformationId, - principalTable: "RevisionInformations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "RevInfoTestMerges", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - TestMergeId = table.Column(nullable: false), - RevisionInformationId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RevInfoTestMerges", x => x.Id); - table.ForeignKey( - name: "FK_RevInfoTestMerges_RevisionInformations_RevisionInformationId", - column: x => x.RevisionInformationId, - principalTable: "RevisionInformations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_RevInfoTestMerges_TestMerges_TestMergeId", - column: x => x.TestMergeId, - principalTable: "TestMerges", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ReattachInformations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - ChatCommandsJson = table.Column(nullable: false), - ChatChannelsJson = table.Column(nullable: false), - ServerCommandsJson = table.Column(nullable: false), - AccessIdentifier = table.Column(nullable: false), - ProcessId = table.Column(nullable: false), - IsPrimary = table.Column(nullable: false), - Port = table.Column(nullable: false), - RebootState = table.Column(nullable: false), - CompileJobId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ReattachInformations", x => x.Id); - table.ForeignKey( - name: "FK_ReattachInformations_CompileJobs_CompileJobId", - column: x => x.CompileJobId, - principalTable: "CompileJobs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "WatchdogReattachInformations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - AlphaIsActive = table.Column(nullable: false), - InstanceId = table.Column(nullable: false), - AlphaId = table.Column(nullable: true), - BravoId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WatchdogReattachInformations", x => x.Id); - table.ForeignKey( - name: "FK_WatchdogReattachInformations_ReattachInformations_AlphaId", - column: x => x.AlphaId, - principalTable: "ReattachInformations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WatchdogReattachInformations_ReattachInformations_BravoId", - column: x => x.BravoId, - principalTable: "ReattachInformations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_WatchdogReattachInformations_Instances_InstanceId", - column: x => x.InstanceId, - principalTable: "Instances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_ChatBots_InstanceId_Name", - table: "ChatBots", - columns: new[] { "InstanceId", "Name" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ChatChannels_ChatSettingsId_DiscordChannelId", - table: "ChatChannels", - columns: new[] { "ChatSettingsId", "DiscordChannelId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ChatChannels_ChatSettingsId_IrcChannel", - table: "ChatChannels", - columns: new[] { "ChatSettingsId", "IrcChannel" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_CompileJobs_DirectoryName", - table: "CompileJobs", - column: "DirectoryName"); - - migrationBuilder.CreateIndex( - name: "IX_CompileJobs_JobId", - table: "CompileJobs", - column: "JobId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_CompileJobs_RevisionInformationId", - table: "CompileJobs", - column: "RevisionInformationId"); - - migrationBuilder.CreateIndex( - name: "IX_DreamDaemonSettings_InstanceId", - table: "DreamDaemonSettings", - column: "InstanceId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_DreamMakerSettings_InstanceId", - table: "DreamMakerSettings", - column: "InstanceId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Instances_Path", - table: "Instances", - column: "Path", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_InstanceUsers_InstanceId", - table: "InstanceUsers", - column: "InstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_InstanceUsers_UserId_InstanceId", - table: "InstanceUsers", - columns: new[] { "UserId", "InstanceId" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Jobs_CancelledById", - table: "Jobs", - column: "CancelledById"); - - migrationBuilder.CreateIndex( - name: "IX_Jobs_InstanceId", - table: "Jobs", - column: "InstanceId"); - - migrationBuilder.CreateIndex( - name: "IX_Jobs_StartedById", - table: "Jobs", - column: "StartedById"); - - migrationBuilder.CreateIndex( - name: "IX_ReattachInformations_CompileJobId", - table: "ReattachInformations", - column: "CompileJobId"); - - migrationBuilder.CreateIndex( - name: "IX_RepositorySettings_InstanceId", - table: "RepositorySettings", - column: "InstanceId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_RevInfoTestMerges_RevisionInformationId", - table: "RevInfoTestMerges", - column: "RevisionInformationId"); - - migrationBuilder.CreateIndex( - name: "IX_RevInfoTestMerges_TestMergeId", - table: "RevInfoTestMerges", - column: "TestMergeId"); - - migrationBuilder.CreateIndex( - name: "IX_RevisionInformations_InstanceId_CommitSha", - table: "RevisionInformations", - columns: new[] { "InstanceId", "CommitSha" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TestMerges_MergedById", - table: "TestMerges", - column: "MergedById"); - - migrationBuilder.CreateIndex( - name: "IX_TestMerges_PrimaryRevisionInformationId", - table: "TestMerges", - column: "PrimaryRevisionInformationId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_CanonicalName", - table: "Users", - column: "CanonicalName", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_CreatedById", - table: "Users", - column: "CreatedById"); - - migrationBuilder.CreateIndex( - name: "IX_Users_SystemIdentifier", - table: "Users", - column: "SystemIdentifier", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_WatchdogReattachInformations_AlphaId", - table: "WatchdogReattachInformations", - column: "AlphaId"); - - migrationBuilder.CreateIndex( - name: "IX_WatchdogReattachInformations_BravoId", - table: "WatchdogReattachInformations", - column: "BravoId"); - - migrationBuilder.CreateIndex( - name: "IX_WatchdogReattachInformations_InstanceId", - table: "WatchdogReattachInformations", - column: "InstanceId", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - if (migrationBuilder == null) - throw new ArgumentNullException(nameof(migrationBuilder)); - - migrationBuilder.DropTable( - name: "ChatChannels"); - - migrationBuilder.DropTable( - name: "DreamDaemonSettings"); - - migrationBuilder.DropTable( - name: "DreamMakerSettings"); - - migrationBuilder.DropTable( - name: "InstanceUsers"); - - migrationBuilder.DropTable( - name: "RepositorySettings"); - - migrationBuilder.DropTable( - name: "RevInfoTestMerges"); - - migrationBuilder.DropTable( - name: "WatchdogReattachInformations"); - - migrationBuilder.DropTable( - name: "ChatBots"); - - migrationBuilder.DropTable( - name: "TestMerges"); - - migrationBuilder.DropTable( - name: "ReattachInformations"); - - migrationBuilder.DropTable( - name: "CompileJobs"); - - migrationBuilder.DropTable( - name: "Jobs"); - - migrationBuilder.DropTable( - name: "RevisionInformations"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "Instances"); - } - } -} diff --git a/src/Tgstation.Server.Host/Database/Migrations/SqliteDatabaseContextModelSnapshot.cs b/src/Tgstation.Server.Host/Database/Migrations/SqliteDatabaseContextModelSnapshot.cs deleted file mode 100644 index d43e7a69e8..0000000000 --- a/src/Tgstation.Server.Host/Database/Migrations/SqliteDatabaseContextModelSnapshot.cs +++ /dev/null @@ -1,815 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; - -namespace Tgstation.Server.Host.Database.Migrations -{ - [DbContext(typeof(SqliteDatabaseContext))] - partial class SqliteDatabaseContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.3"); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatBot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelLimit") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ConnectionString") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(100); - - b.Property("Provider") - .HasColumnType("INTEGER"); - - b.Property("ReconnectionInterval") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId", "Name") - .IsUnique(); - - b.ToTable("ChatBots"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ChatChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChatSettingsId") - .HasColumnType("INTEGER"); - - b.Property("DiscordChannelId") - .HasColumnType("INTEGER"); - - b.Property("IrcChannel") - .HasColumnType("TEXT") - .HasMaxLength(100); - - b.Property("IsAdminChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("IsUpdatesChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("IsWatchdogChannel") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("Tag") - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("ByondVersion") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DMApiMajorVersion"); - - b.Property("DMApiMinorVersion"); - - b.Property("DMApiPatchVersion"); - - b.Property("DirectoryName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DmeName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("JobId") - .HasColumnType("INTEGER"); - - b.Property("MinimumSecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("Output") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("RevisionInformationId") - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("AccessToken") - .HasColumnType("TEXT"); - - b.Property("AllowWebClient") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("AutoStart") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("PrimaryPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ProcessId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("SecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("SoftRestart") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("SoftShutdown") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("StartupTimeout") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamDaemonSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.DreamMakerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ApiValidationPort") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ApiValidationSecurityLevel") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("ProjectName") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("DreamMakerSettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.Instance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoUpdateInterval") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ChatBotLimit") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ConfigurationType") - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("Online") - .IsRequired() - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("ByondRights") - .HasColumnType("INTEGER"); - - b.Property("ChatBotRights") - .HasColumnType("INTEGER"); - - b.Property("ConfigurationRights") - .HasColumnType("INTEGER"); - - b.Property("DreamDaemonRights") - .HasColumnType("INTEGER"); - - b.Property("DreamMakerRights") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("InstanceUserRights") - .HasColumnType("INTEGER"); - - b.Property("RepositoryRights") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("CancelRight") - .HasColumnType("INTEGER"); - - b.Property("CancelRightsType") - .HasColumnType("INTEGER"); - - b.Property("Cancelled") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("CancelledById") - .HasColumnType("INTEGER"); - - b.Property("Description") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExceptionDetails") - .HasColumnType("TEXT"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("StartedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("StartedById") - .HasColumnType("INTEGER") - .IsRequired(); - - b.Property("StoppedAt") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("CancelledById"); - - b.HasIndex("InstanceId"); - - b.HasIndex("StartedById"); - - b.ToTable("Jobs"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.ReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AccessIdentifier") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ChatChannelsJson") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ChatCommandsJson") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CompileJobId") - .HasColumnType("INTEGER"); - - b.Property("IsPrimary") - .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("INTEGER"); - - b.Property("AccessToken") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("AccessUser") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("AutoUpdatesKeepTestMerges") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("AutoUpdatesSynchronize") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("CommitterEmail") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("CommitterName") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("PostTestMergeComment") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("PushTestMergeCommits") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("ShowTestMergeCommitters") - .IsRequired() - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("RepositorySettings"); - }); - - modelBuilder.Entity("Tgstation.Server.Host.Models.RevInfoTestMerge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("RevisionInformationId") - .HasColumnType("INTEGER"); - - b.Property("TestMergeId") - .HasColumnType("INTEGER"); - - 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("INTEGER"); - - b.Property("CommitSha") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(40); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.Property("OriginCommitSha") - .IsRequired() - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("Author") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("BodyAtMerge") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Comment") - .HasColumnType("TEXT") - .HasMaxLength(10000); - - b.Property("MergedAt") - .HasColumnType("TEXT"); - - b.Property("MergedById") - .HasColumnType("INTEGER") - .IsRequired(); - - b.Property("Number") - .HasColumnType("INTEGER"); - - b.Property("PrimaryRevisionInformationId") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("PullRequestRevision") - .IsRequired() - .HasColumnType("TEXT") - .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("INTEGER"); - - b.Property("AdministrationRights") - .HasColumnType("INTEGER"); - - b.Property("CanonicalName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("CreatedById") - .HasColumnType("INTEGER"); - - b.Property("Enabled") - .IsRequired() - .HasColumnType("INTEGER"); - - b.Property("InstanceManagerRights") - .HasColumnType("INTEGER"); - - b.Property("LastPasswordUpdate") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .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.WatchdogReattachInformation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AlphaId") - .HasColumnType("INTEGER"); - - b.Property("AlphaIsActive") - .HasColumnType("INTEGER"); - - b.Property("BravoId") - .HasColumnType("INTEGER"); - - b.Property("InstanceId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AlphaId"); - - b.HasIndex("BravoId"); - - b.HasIndex("InstanceId") - .IsUnique(); - - b.ToTable("WatchdogReattachInformations"); - }); - - 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.Restrict) - .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.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.Cascade) - .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.Restrict) - .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.WatchdogReattachInformation", 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.WatchdogReattachInformation", "InstanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -}