From db341d43b3dab74fe3681f5172ca9bfeaafa6b6d Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Sat, 18 Jan 2020 21:11:51 -0500 Subject: [PATCH] Adds the Database namespace --- .../Chat/Commands/CommandFactory.cs | 1 + .../Chat/Commands/PullRequestsCommand.cs | 2 +- .../Components/Compiler/DmbFactory.cs | 2 +- .../Components/IInstance.cs | 1 + .../Components/Instance.cs | 18 +++++++++++- .../Components/InstanceFactory.cs | 1 + .../Components/InstanceManager.cs | 1 + .../Components/ReattachInfoHandler.cs | 2 +- .../Components/Watchdog/BasicWatchdog.cs | 1 + .../Watchdog/ExperimentalWatchdog.cs | 1 + .../Components/Watchdog/WatchdogBase.cs | 1 + .../Components/Watchdog/WatchdogFactory.cs | 1 + .../Components/Watchdog/WindowsWatchdog.cs | 29 ++++++++++--------- .../Watchdog/WindowsWatchdogFactory.cs | 16 +++++----- .../Configuration/DatabaseConfiguration.cs | 2 +- .../Controllers/AdministrationController.cs | 2 +- .../Controllers/ApiController.cs | 2 +- .../Controllers/ByondController.cs | 1 + .../Controllers/ChatController.cs | 1 + .../Controllers/ConfigurationController.cs | 1 + .../Controllers/DreamDaemonController.cs | 1 + .../Controllers/DreamMakerController.cs | 1 + .../Controllers/HomeController.cs | 1 + .../Controllers/InstanceController.cs | 1 + .../Controllers/InstanceUserController.cs | 1 + .../Controllers/JobController.cs | 1 + .../Controllers/RepositoryController.cs | 1 + .../Controllers/UserController.cs | 3 +- src/Tgstation.Server.Host/Core/Application.cs | 2 +- src/Tgstation.Server.Host/Core/IJobManager.cs | 1 + src/Tgstation.Server.Host/Core/JobManager.cs | 1 + src/Tgstation.Server.Host/Core/SetupWizard.cs | 1 + .../DatabaseConnectionFactory.cs | 2 +- .../{Models => Database}/DatabaseContext.cs | 3 +- .../DatabaseContextFactory.cs | 3 +- .../{Models => Database}/DatabaseSeeder.cs | 12 +++++--- .../DesignTimeDbContextFactoryHelpers.cs | 2 +- .../MySqlDesignTimeDbContextFactory.cs | 3 +- .../SqlServerDesignTimeDbContextFactory.cs | 3 +- .../IDatabaseConnectionFactory.cs | 4 +-- .../{Models => Database}/IDatabaseContext.cs | 9 +++--- .../IDatabaseContextFactory.cs | 3 +- .../{Models => Database}/IDatabaseSeeder.cs | 2 +- .../MySqlDatabaseContext.cs | 2 +- .../SqlServerDatabaseContext.cs | 2 +- ...20180906135553_MSInitialCreate.Designer.cs | 1 + ...20180906143029_MYInitialCreate.Designer.cs | 1 + ...918020726_MYAddMinimumSecurity.Designer.cs | 1 + ...918021228_MSAddMinimumSecurity.Designer.cs | 1 + ...MYNullableAndForeignKeyCleanup.Designer.cs | 1 + ...MSNullableAndForeignKeyCleanup.Designer.cs | 1 + ...5_MSReattachCompileJobRequired.Designer.cs | 1 + ...4_MYReattachCompileJobRequired.Designer.cs | 1 + ...1534_MSToggleTestmergeComments.Designer.cs | 1 + ...1549_MYToggleTestmergeComments.Designer.cs | 1 + ...190219041825_MSFixRevInfoIndex.Designer.cs | 1 + ...190219042440_MYFixRevInfoIndex.Designer.cs | 1 + .../MySqlDatabaseContextModelSnapshot.cs | 1 + .../SqlServerDatabaseContextModelSnapshot.cs | 1 + .../Security/AuthenticationContextFactory.cs | 1 + .../Security/ClaimsInjector.cs | 2 +- .../Watchdog/TestExperimentalWatchdog.cs | 1 + .../Core/TestSetupWizard.cs | 1 + .../TestDatabaseConnectionFactory.cs | 2 +- .../TestDatabaseContextFactory.cs | 2 +- 65 files changed, 119 insertions(+), 55 deletions(-) rename src/Tgstation.Server.Host/{Core => Database}/DatabaseConnectionFactory.cs (95%) rename src/Tgstation.Server.Host/{Models => Database}/DatabaseContext.cs (99%) rename src/Tgstation.Server.Host/{Core => Database}/DatabaseContextFactory.cs (94%) rename src/Tgstation.Server.Host/{Models => Database}/DatabaseSeeder.cs (85%) rename src/Tgstation.Server.Host/{Models/Migrations => Database/Design}/DesignTimeDbContextFactoryHelpers.cs (96%) rename src/Tgstation.Server.Host/{Models/Migrations => Database/Design}/MySqlDesignTimeDbContextFactory.cs (89%) rename src/Tgstation.Server.Host/{Models/Migrations => Database/Design}/SqlServerDesignTimeDbContextFactory.cs (90%) rename src/Tgstation.Server.Host/{Core => Database}/IDatabaseConnectionFactory.cs (85%) rename src/Tgstation.Server.Host/{Models => Database}/IDatabaseContext.cs (91%) rename src/Tgstation.Server.Host/{Core => Database}/IDatabaseContextFactory.cs (88%) rename src/Tgstation.Server.Host/{Models => Database}/IDatabaseSeeder.cs (96%) rename src/Tgstation.Server.Host/{Models => Database}/MySqlDatabaseContext.cs (98%) rename src/Tgstation.Server.Host/{Models => Database}/SqlServerDatabaseContext.cs (97%) rename tests/Tgstation.Server.Host.Tests/{Core => Database}/TestDatabaseConnectionFactory.cs (95%) rename tests/Tgstation.Server.Host.Tests/{Core => Database}/TestDatabaseContextFactory.cs (97%) diff --git a/src/Tgstation.Server.Host/Components/Chat/Commands/CommandFactory.cs b/src/Tgstation.Server.Host/Components/Chat/Commands/CommandFactory.cs index 870bb03b7a..b3dbd72daa 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Commands/CommandFactory.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Commands/CommandFactory.cs @@ -4,6 +4,7 @@ using Tgstation.Server.Host.Components.Byond; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Components.Chat.Commands { diff --git a/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs b/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs index 8e2b9f9c19..989fc8026d 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; -using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Components.Chat.Commands { diff --git a/src/Tgstation.Server.Host/Components/Compiler/DmbFactory.cs b/src/Tgstation.Server.Host/Components/Compiler/DmbFactory.cs index bd6b84fddd..7c8426045e 100644 --- a/src/Tgstation.Server.Host/Components/Compiler/DmbFactory.cs +++ b/src/Tgstation.Server.Host/Components/Compiler/DmbFactory.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.Models; diff --git a/src/Tgstation.Server.Host/Components/IInstance.cs b/src/Tgstation.Server.Host/Components/IInstance.cs index 299dbe6fc0..e8db125904 100644 --- a/src/Tgstation.Server.Host/Components/IInstance.cs +++ b/src/Tgstation.Server.Host/Components/IInstance.cs @@ -7,6 +7,7 @@ using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.StaticFiles; using Tgstation.Server.Host.Components.Watchdog; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Components diff --git a/src/Tgstation.Server.Host/Components/Instance.cs b/src/Tgstation.Server.Host/Components/Instance.cs index a32b22894c..0faadcef67 100644 --- a/src/Tgstation.Server.Host/Components/Instance.cs +++ b/src/Tgstation.Server.Host/Components/Instance.cs @@ -14,6 +14,7 @@ using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Components @@ -109,7 +110,22 @@ namespace Tgstation.Server.Host.Components /// The value of /// The value of /// The value of - public Instance(Api.Models.Instance metadata, IRepositoryManager repositoryManager, IByondManager byondManager, IDreamMaker dreamMaker, IWatchdog watchdog, IChat chat, StaticFiles.IConfiguration configuration, ICompileJobConsumer compileJobConsumer, IDatabaseContextFactory databaseContextFactory, IDmbFactory dmbFactory, IJobManager jobManager, IEventConsumer eventConsumer, IGitHubClientFactory gitHubClientFactory, ILogger logger) + public Instance( + Api.Models.Instance metadata, + IRepositoryManager repositoryManager, + IByondManager byondManager, + IDreamMaker dreamMaker, + IWatchdog watchdog, + IChat chat, + StaticFiles.IConfiguration + configuration, + ICompileJobConsumer compileJobConsumer, + IDatabaseContextFactory databaseContextFactory, + IDmbFactory dmbFactory, + IJobManager jobManager, + IEventConsumer eventConsumer, + IGitHubClientFactory gitHubClientFactory, + ILogger logger) { this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata)); RepositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager)); diff --git a/src/Tgstation.Server.Host/Components/InstanceFactory.cs b/src/Tgstation.Server.Host/Components/InstanceFactory.cs index c3f58bfc4b..d9c3a797b6 100644 --- a/src/Tgstation.Server.Host/Components/InstanceFactory.cs +++ b/src/Tgstation.Server.Host/Components/InstanceFactory.cs @@ -10,6 +10,7 @@ using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.Security; using Tgstation.Server.Host.System; diff --git a/src/Tgstation.Server.Host/Components/InstanceManager.cs b/src/Tgstation.Server.Host/Components/InstanceManager.cs index f8f63206ff..929df490ef 100644 --- a/src/Tgstation.Server.Host/Components/InstanceManager.cs +++ b/src/Tgstation.Server.Host/Components/InstanceManager.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; namespace Tgstation.Server.Host.Components diff --git a/src/Tgstation.Server.Host/Components/ReattachInfoHandler.cs b/src/Tgstation.Server.Host/Components/ReattachInfoHandler.cs index 6c666e2a7f..a1c31f7d78 100644 --- a/src/Tgstation.Server.Host/Components/ReattachInfoHandler.cs +++ b/src/Tgstation.Server.Host/Components/ReattachInfoHandler.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Components.Watchdog; -using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Z.EntityFramework.Plus; namespace Tgstation.Server.Host.Components diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs index e000b8d85f..9fde03e7b6 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs @@ -9,6 +9,7 @@ using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Components.Watchdog { diff --git a/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs index 41baa57d13..205d7fa220 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/ExperimentalWatchdog.cs @@ -10,6 +10,7 @@ using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Components.Watchdog { diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index 6a5eeefb18..012150d8ee 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -17,6 +17,7 @@ using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Components.Interop; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Extensions; namespace Tgstation.Server.Host.Components.Watchdog diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogFactory.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogFactory.cs index c56eff2067..f46de3a746 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogFactory.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogFactory.cs @@ -7,6 +7,7 @@ using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; namespace Tgstation.Server.Host.Components.Watchdog diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs index 24b7eeb594..d71920b8fe 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdog.cs @@ -8,6 +8,7 @@ using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; namespace Tgstation.Server.Host.Components.Watchdog @@ -73,20 +74,20 @@ namespace Tgstation.Server.Host.Components.Watchdog DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( - chat, - sessionControllerFactory, - dmbFactory, - reattachInfoHandler, - databaseContextFactory, - byondTopicSender, - eventConsumer, - jobManager, - serverControl, - asyncDelayer, - logger, - initialLaunchParameters, - instance, - autoStart) + chat, + sessionControllerFactory, + dmbFactory, + reattachInfoHandler, + databaseContextFactory, + byondTopicSender, + eventConsumer, + jobManager, + serverControl, + asyncDelayer, + logger, + initialLaunchParameters, + instance, + autoStart) { try { diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs index 2866838eac..a84eb981f8 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WindowsWatchdogFactory.cs @@ -7,6 +7,7 @@ using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; namespace Tgstation.Server.Host.Components.Watchdog @@ -41,13 +42,14 @@ namespace Tgstation.Server.Host.Components.Watchdog IAsyncDelayer asyncDelayer, ISymlinkFactory symlinkFactory, IOptions generalConfigurationOptions) - : base(serverControl, - loggerFactory, - databaseContextFactory, - byondTopicSender, - jobManager, - asyncDelayer, - generalConfigurationOptions) + : base( + serverControl, + loggerFactory, + databaseContextFactory, + byondTopicSender, + jobManager, + asyncDelayer, + generalConfigurationOptions) { this.symlinkFactory = symlinkFactory ?? throw new ArgumentNullException(nameof(symlinkFactory)); } diff --git a/src/Tgstation.Server.Host/Configuration/DatabaseConfiguration.cs b/src/Tgstation.Server.Host/Configuration/DatabaseConfiguration.cs index 76aec1d0cc..cba1b03672 100644 --- a/src/Tgstation.Server.Host/Configuration/DatabaseConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/DatabaseConfiguration.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json.Converters; namespace Tgstation.Server.Host.Configuration { /// - /// Configuration options for the + /// Configuration options for the /// sealed class DatabaseConfiguration { diff --git a/src/Tgstation.Server.Host/Controllers/AdministrationController.cs b/src/Tgstation.Server.Host/Controllers/AdministrationController.cs index 4e568dc8e7..981d207959 100644 --- a/src/Tgstation.Server.Host/Controllers/AdministrationController.cs +++ b/src/Tgstation.Server.Host/Controllers/AdministrationController.cs @@ -15,9 +15,9 @@ using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Extensions; using Tgstation.Server.Host.IO; -using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Tgstation.Server.Host.System; diff --git a/src/Tgstation.Server.Host/Controllers/ApiController.cs b/src/Tgstation.Server.Host/Controllers/ApiController.cs index c5804466aa..d6e7c2aff9 100644 --- a/src/Tgstation.Server.Host/Controllers/ApiController.cs +++ b/src/Tgstation.Server.Host/Controllers/ApiController.cs @@ -9,7 +9,7 @@ using System.Net; using System.Threading.Tasks; using Tgstation.Server.Api; using Tgstation.Server.Api.Models; -using Tgstation.Server.Host.Models; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Security; namespace Tgstation.Server.Host.Controllers diff --git a/src/Tgstation.Server.Host/Controllers/ByondController.cs b/src/Tgstation.Server.Host/Controllers/ByondController.cs index 52872441b6..1b25c67941 100644 --- a/src/Tgstation.Server.Host/Controllers/ByondController.cs +++ b/src/Tgstation.Server.Host/Controllers/ByondController.cs @@ -10,6 +10,7 @@ using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/ChatController.cs b/src/Tgstation.Server.Host/Controllers/ChatController.cs index bbc3ba1f97..7346a52af3 100644 --- a/src/Tgstation.Server.Host/Controllers/ChatController.cs +++ b/src/Tgstation.Server.Host/Controllers/ChatController.cs @@ -13,6 +13,7 @@ using Tgstation.Server.Api; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Z.EntityFramework.Plus; diff --git a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs index 363be52b3a..e9ed0a9079 100644 --- a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs +++ b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs @@ -10,6 +10,7 @@ using Tgstation.Server.Api; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs index d9d8324e25..705b48680e 100644 --- a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs +++ b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs @@ -14,6 +14,7 @@ using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs b/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs index 1a9b4e6bcd..3ae902446f 100644 --- a/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs +++ b/src/Tgstation.Server.Host/Controllers/DreamMakerController.cs @@ -12,6 +12,7 @@ using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/HomeController.cs b/src/Tgstation.Server.Host/Controllers/HomeController.cs index 86657c2019..6bb12428d7 100644 --- a/src/Tgstation.Server.Host/Controllers/HomeController.cs +++ b/src/Tgstation.Server.Host/Controllers/HomeController.cs @@ -14,6 +14,7 @@ using System.Threading.Tasks; using Tgstation.Server.Api; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Wangkanai.Detection; diff --git a/src/Tgstation.Server.Host/Controllers/InstanceController.cs b/src/Tgstation.Server.Host/Controllers/InstanceController.cs index 335800e912..46a1f46c20 100644 --- a/src/Tgstation.Server.Host/Controllers/InstanceController.cs +++ b/src/Tgstation.Server.Host/Controllers/InstanceController.cs @@ -16,6 +16,7 @@ using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/InstanceUserController.cs b/src/Tgstation.Server.Host/Controllers/InstanceUserController.cs index dc998b9788..9ad8d65a8c 100644 --- a/src/Tgstation.Server.Host/Controllers/InstanceUserController.cs +++ b/src/Tgstation.Server.Host/Controllers/InstanceUserController.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Tgstation.Server.Api; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Z.EntityFramework.Plus; diff --git a/src/Tgstation.Server.Host/Controllers/JobController.cs b/src/Tgstation.Server.Host/Controllers/JobController.cs index 5dddb4bd01..7b05ec21ba 100644 --- a/src/Tgstation.Server.Host/Controllers/JobController.cs +++ b/src/Tgstation.Server.Host/Controllers/JobController.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Api; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs index c6fd18a741..36e612e91a 100644 --- a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs +++ b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs @@ -17,6 +17,7 @@ using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Components; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; diff --git a/src/Tgstation.Server.Host/Controllers/UserController.cs b/src/Tgstation.Server.Host/Controllers/UserController.cs index 8988c62cbb..9e35fdf48d 100644 --- a/src/Tgstation.Server.Host/Controllers/UserController.cs +++ b/src/Tgstation.Server.Host/Controllers/UserController.cs @@ -12,6 +12,7 @@ using Tgstation.Server.Api; using Tgstation.Server.Api.Models; using Tgstation.Server.Api.Rights; using Tgstation.Server.Host.Configuration; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; @@ -75,7 +76,7 @@ namespace Tgstation.Server.Host.Controllers /// /// Attempt to change the password of a given . /// - /// The to update. + /// The user to update. /// The new password. /// on success, if is too short. BadRequestObjectResult TrySetPassword(Models.User dbUser, string newPassword) diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 5213d170a5..e7df17a381 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -32,9 +32,9 @@ using Tgstation.Server.Host.Components.Repository; using Tgstation.Server.Host.Components.Watchdog; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.Controllers; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Extensions; using Tgstation.Server.Host.IO; -using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Tgstation.Server.Host.System; diff --git a/src/Tgstation.Server.Host/Core/IJobManager.cs b/src/Tgstation.Server.Host/Core/IJobManager.cs index 6599b59a03..085023b68f 100644 --- a/src/Tgstation.Server.Host/Core/IJobManager.cs +++ b/src/Tgstation.Server.Host/Core/IJobManager.cs @@ -2,6 +2,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Core diff --git a/src/Tgstation.Server.Host/Core/JobManager.cs b/src/Tgstation.Server.Host/Core/JobManager.cs index 42b9bba454..c26b30964d 100644 --- a/src/Tgstation.Server.Host/Core/JobManager.cs +++ b/src/Tgstation.Server.Host/Core/JobManager.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Core diff --git a/src/Tgstation.Server.Host/Core/SetupWizard.cs b/src/Tgstation.Server.Host/Core/SetupWizard.cs index 304ff8cbca..d685044ec7 100644 --- a/src/Tgstation.Server.Host/Core/SetupWizard.cs +++ b/src/Tgstation.Server.Host/Core/SetupWizard.cs @@ -14,6 +14,7 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Configuration; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.System; diff --git a/src/Tgstation.Server.Host/Core/DatabaseConnectionFactory.cs b/src/Tgstation.Server.Host/Database/DatabaseConnectionFactory.cs similarity index 95% rename from src/Tgstation.Server.Host/Core/DatabaseConnectionFactory.cs rename to src/Tgstation.Server.Host/Database/DatabaseConnectionFactory.cs index 781852ec6a..91ef82de8d 100644 --- a/src/Tgstation.Server.Host/Core/DatabaseConnectionFactory.cs +++ b/src/Tgstation.Server.Host/Database/DatabaseConnectionFactory.cs @@ -4,7 +4,7 @@ using System.Data.Common; using System.Data.SqlClient; using Tgstation.Server.Host.Configuration; -namespace Tgstation.Server.Host.Core +namespace Tgstation.Server.Host.Database { /// sealed class DatabaseConnectionFactory : IDatabaseConnectionFactory diff --git a/src/Tgstation.Server.Host/Models/DatabaseContext.cs b/src/Tgstation.Server.Host/Database/DatabaseContext.cs similarity index 99% rename from src/Tgstation.Server.Host/Models/DatabaseContext.cs rename to src/Tgstation.Server.Host/Database/DatabaseContext.cs index 5572c9b0e8..5be860c5a5 100644 --- a/src/Tgstation.Server.Host/Models/DatabaseContext.cs +++ b/src/Tgstation.Server.Host/Database/DatabaseContext.cs @@ -10,9 +10,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Configuration; +using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Models.Migrations; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// #pragma warning disable CA1506 // TODO: Decomplexify diff --git a/src/Tgstation.Server.Host/Core/DatabaseContextFactory.cs b/src/Tgstation.Server.Host/Database/DatabaseContextFactory.cs similarity index 94% rename from src/Tgstation.Server.Host/Core/DatabaseContextFactory.cs rename to src/Tgstation.Server.Host/Database/DatabaseContextFactory.cs index fc23255d12..2522ca307e 100644 --- a/src/Tgstation.Server.Host/Core/DatabaseContextFactory.cs +++ b/src/Tgstation.Server.Host/Database/DatabaseContextFactory.cs @@ -1,9 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using System; using System.Threading.Tasks; -using Tgstation.Server.Host.Models; -namespace Tgstation.Server.Host.Core +namespace Tgstation.Server.Host.Database { /// sealed class DatabaseContextFactory : IDatabaseContextFactory diff --git a/src/Tgstation.Server.Host/Models/DatabaseSeeder.cs b/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs similarity index 85% rename from src/Tgstation.Server.Host/Models/DatabaseSeeder.cs rename to src/Tgstation.Server.Host/Database/DatabaseSeeder.cs index fbe245ad79..73f5128335 100644 --- a/src/Tgstation.Server.Host/Models/DatabaseSeeder.cs +++ b/src/Tgstation.Server.Host/Database/DatabaseSeeder.cs @@ -4,9 +4,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Api.Rights; +using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// sealed class DatabaseSeeder : IDatabaseSeeder @@ -20,7 +21,10 @@ namespace Tgstation.Server.Host.Models /// Construct a /// /// The value of - public DatabaseSeeder(ICryptographySuite cryptographySuite) => this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); + public DatabaseSeeder(ICryptographySuite cryptographySuite) + { + this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite)); + } /// /// Add a default admin to a given @@ -30,9 +34,9 @@ namespace Tgstation.Server.Host.Models { var admin = new User { - AdministrationRights = (AdministrationRights)~0U, + AdministrationRights = ~AdministrationRights.None, CreatedAt = DateTimeOffset.Now, - InstanceManagerRights = (InstanceManagerRights)~0U, + InstanceManagerRights = ~InstanceManagerRights.None, Name = Api.Models.User.AdminName, CanonicalName = Api.Models.User.AdminName.ToUpperInvariant(), Enabled = true, diff --git a/src/Tgstation.Server.Host/Models/Migrations/DesignTimeDbContextFactoryHelpers.cs b/src/Tgstation.Server.Host/Database/Design/DesignTimeDbContextFactoryHelpers.cs similarity index 96% rename from src/Tgstation.Server.Host/Models/Migrations/DesignTimeDbContextFactoryHelpers.cs rename to src/Tgstation.Server.Host/Database/Design/DesignTimeDbContextFactoryHelpers.cs index d6dd7bf154..5071d72ccf 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/DesignTimeDbContextFactoryHelpers.cs +++ b/src/Tgstation.Server.Host/Database/Design/DesignTimeDbContextFactoryHelpers.cs @@ -4,7 +4,7 @@ using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.System; -namespace Tgstation.Server.Host.Models.Migrations +namespace Tgstation.Server.Host.Database.Design { /// /// Contains helpers for creating design time s diff --git a/src/Tgstation.Server.Host/Models/Migrations/MySqlDesignTimeDbContextFactory.cs b/src/Tgstation.Server.Host/Database/Design/MySqlDesignTimeDbContextFactory.cs similarity index 89% rename from src/Tgstation.Server.Host/Models/Migrations/MySqlDesignTimeDbContextFactory.cs rename to src/Tgstation.Server.Host/Database/Design/MySqlDesignTimeDbContextFactory.cs index 45cbec1e27..1a48bd319f 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/MySqlDesignTimeDbContextFactory.cs +++ b/src/Tgstation.Server.Host/Database/Design/MySqlDesignTimeDbContextFactory.cs @@ -2,9 +2,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Logging; +using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; -namespace Tgstation.Server.Host.Models.Migrations +namespace Tgstation.Server.Host.Database.Design { /// sealed class MySqlDesignTimeDbContextFactory : IDesignTimeDbContextFactory diff --git a/src/Tgstation.Server.Host/Models/Migrations/SqlServerDesignTimeDbContextFactory.cs b/src/Tgstation.Server.Host/Database/Design/SqlServerDesignTimeDbContextFactory.cs similarity index 90% rename from src/Tgstation.Server.Host/Models/Migrations/SqlServerDesignTimeDbContextFactory.cs rename to src/Tgstation.Server.Host/Database/Design/SqlServerDesignTimeDbContextFactory.cs index 413bfbc5aa..a935229be5 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/SqlServerDesignTimeDbContextFactory.cs +++ b/src/Tgstation.Server.Host/Database/Design/SqlServerDesignTimeDbContextFactory.cs @@ -2,9 +2,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Logging; +using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; -namespace Tgstation.Server.Host.Models.Migrations +namespace Tgstation.Server.Host.Database.Design { /// sealed class SqlServerDesignTimeDbContextFactory : IDesignTimeDbContextFactory diff --git a/src/Tgstation.Server.Host/Core/IDatabaseConnectionFactory.cs b/src/Tgstation.Server.Host/Database/IDatabaseConnectionFactory.cs similarity index 85% rename from src/Tgstation.Server.Host/Core/IDatabaseConnectionFactory.cs rename to src/Tgstation.Server.Host/Database/IDatabaseConnectionFactory.cs index 3211d1e99f..9ebe790587 100644 --- a/src/Tgstation.Server.Host/Core/IDatabaseConnectionFactory.cs +++ b/src/Tgstation.Server.Host/Database/IDatabaseConnectionFactory.cs @@ -1,10 +1,10 @@ using System.Data.Common; using Tgstation.Server.Host.Configuration; -namespace Tgstation.Server.Host.Core +namespace Tgstation.Server.Host.Database { /// - /// For creating + /// For creating raw s. /// interface IDatabaseConnectionFactory { diff --git a/src/Tgstation.Server.Host/Models/IDatabaseContext.cs b/src/Tgstation.Server.Host/Database/IDatabaseContext.cs similarity index 91% rename from src/Tgstation.Server.Host/Models/IDatabaseContext.cs rename to src/Tgstation.Server.Host/Database/IDatabaseContext.cs index e7c8e9dcd2..a40113f5be 100644 --- a/src/Tgstation.Server.Host/Models/IDatabaseContext.cs +++ b/src/Tgstation.Server.Host/Database/IDatabaseContext.cs @@ -2,8 +2,9 @@ using System; using System.Threading; using System.Threading.Tasks; +using Tgstation.Server.Host.Models; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// /// Represents the database @@ -51,7 +52,7 @@ namespace Tgstation.Server.Host.Models DbSet DreamDaemonSettings { get; set; } /// - /// The in the + /// The s in the /// DbSet ChatBots { get; set; } @@ -66,12 +67,12 @@ namespace Tgstation.Server.Host.Models DbSet RepositorySettings { get; set; } /// - /// The for s + /// The for s /// DbSet ReattachInformations { get; set; } /// - /// The for s + /// The for s /// DbSet WatchdogReattachInformations { get; set; } diff --git a/src/Tgstation.Server.Host/Core/IDatabaseContextFactory.cs b/src/Tgstation.Server.Host/Database/IDatabaseContextFactory.cs similarity index 88% rename from src/Tgstation.Server.Host/Core/IDatabaseContextFactory.cs rename to src/Tgstation.Server.Host/Database/IDatabaseContextFactory.cs index 305092416c..7d625a86e7 100644 --- a/src/Tgstation.Server.Host/Core/IDatabaseContextFactory.cs +++ b/src/Tgstation.Server.Host/Database/IDatabaseContextFactory.cs @@ -1,8 +1,7 @@ using System; using System.Threading.Tasks; -using Tgstation.Server.Host.Models; -namespace Tgstation.Server.Host.Core +namespace Tgstation.Server.Host.Database { /// /// Factory for scoping usage of s. Meant for use by diff --git a/src/Tgstation.Server.Host/Models/IDatabaseSeeder.cs b/src/Tgstation.Server.Host/Database/IDatabaseSeeder.cs similarity index 96% rename from src/Tgstation.Server.Host/Models/IDatabaseSeeder.cs rename to src/Tgstation.Server.Host/Database/IDatabaseSeeder.cs index 291f6be3fa..18f9440418 100644 --- a/src/Tgstation.Server.Host/Models/IDatabaseSeeder.cs +++ b/src/Tgstation.Server.Host/Database/IDatabaseSeeder.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// /// For initially seeding a database diff --git a/src/Tgstation.Server.Host/Models/MySqlDatabaseContext.cs b/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs similarity index 98% rename from src/Tgstation.Server.Host/Models/MySqlDatabaseContext.cs rename to src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs index 718fc04d98..593aa93519 100644 --- a/src/Tgstation.Server.Host/Models/MySqlDatabaseContext.cs +++ b/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs @@ -6,7 +6,7 @@ using Pomelo.EntityFrameworkCore.MySql.Infrastructure; using System; using Tgstation.Server.Host.Configuration; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// /// for MySQL diff --git a/src/Tgstation.Server.Host/Models/SqlServerDatabaseContext.cs b/src/Tgstation.Server.Host/Database/SqlServerDatabaseContext.cs similarity index 97% rename from src/Tgstation.Server.Host/Models/SqlServerDatabaseContext.cs rename to src/Tgstation.Server.Host/Database/SqlServerDatabaseContext.cs index 94240566d3..0acda9944f 100644 --- a/src/Tgstation.Server.Host/Models/SqlServerDatabaseContext.cs +++ b/src/Tgstation.Server.Host/Database/SqlServerDatabaseContext.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Tgstation.Server.Host.Configuration; -namespace Tgstation.Server.Host.Models +namespace Tgstation.Server.Host.Database { /// /// for Sqlserver diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs index dae77c6047..f5a3868f47 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180906135553_MSInitialCreate.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs index 3c1a424266..fe68368e68 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180906143029_MYInitialCreate.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs index 0c4538790b..dad97d04a0 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180918020726_MYAddMinimumSecurity.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs index 6223542618..7fd4819b71 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180918021228_MSAddMinimumSecurity.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs index c267dc1782..bd1692cd78 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180918204520_MYNullableAndForeignKeyCleanup.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs index d8bf97f528..41e7cd3d22 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180918205224_MSNullableAndForeignKeyCleanup.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs index 5c778ac640..bb8f71f024 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180926033145_MSReattachCompileJobRequired.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs index 600d1dd972..2428009bdc 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20180926034014_MYReattachCompileJobRequired.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs index 309149de82..e6d62e22c9 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20181124231534_MSToggleTestmergeComments.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs index ac92efde33..50d60eb5db 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20181124231549_MYToggleTestmergeComments.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs index 2bdb6af82f..0097146a76 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20190219041825_MSFixRevInfoIndex.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs b/src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs index dffe797032..e037584904 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/20190219042440_MYFixRevInfoIndex.Designer.cs @@ -3,6 +3,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/MySqlDatabaseContextModelSnapshot.cs b/src/Tgstation.Server.Host/Models/Migrations/MySqlDatabaseContextModelSnapshot.cs index 2ddc0fb4e3..47d90d047d 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/MySqlDatabaseContextModelSnapshot.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/MySqlDatabaseContextModelSnapshot.cs @@ -2,6 +2,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Models/Migrations/SqlServerDatabaseContextModelSnapshot.cs b/src/Tgstation.Server.Host/Models/Migrations/SqlServerDatabaseContextModelSnapshot.cs index 9433a4bf44..57edfcf3a1 100644 --- a/src/Tgstation.Server.Host/Models/Migrations/SqlServerDatabaseContextModelSnapshot.cs +++ b/src/Tgstation.Server.Host/Models/Migrations/SqlServerDatabaseContextModelSnapshot.cs @@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Models.Migrations { diff --git a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs index bfe70be61d..948a92fa55 100644 --- a/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs +++ b/src/Tgstation.Server.Host/Security/AuthenticationContextFactory.cs @@ -3,6 +3,7 @@ using System; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Security diff --git a/src/Tgstation.Server.Host/Security/ClaimsInjector.cs b/src/Tgstation.Server.Host/Security/ClaimsInjector.cs index c3b67cb489..6894e2c682 100644 --- a/src/Tgstation.Server.Host/Security/ClaimsInjector.cs +++ b/src/Tgstation.Server.Host/Security/ClaimsInjector.cs @@ -9,7 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Api; using Tgstation.Server.Api.Rights; -using Tgstation.Server.Host.Models; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Security { diff --git a/tests/Tgstation.Server.Host.Tests/Components/Watchdog/TestExperimentalWatchdog.cs b/tests/Tgstation.Server.Host.Tests/Components/Watchdog/TestExperimentalWatchdog.cs index c2bc002eff..c2340b3b5c 100644 --- a/tests/Tgstation.Server.Host.Tests/Components/Watchdog/TestExperimentalWatchdog.cs +++ b/tests/Tgstation.Server.Host.Tests/Components/Watchdog/TestExperimentalWatchdog.cs @@ -10,6 +10,7 @@ using Tgstation.Server.Api.Models.Internal; using Tgstation.Server.Host.Components.Chat; using Tgstation.Server.Host.Components.Compiler; using Tgstation.Server.Host.Core; +using Tgstation.Server.Host.Database; namespace Tgstation.Server.Host.Components.Watchdog.Tests { diff --git a/tests/Tgstation.Server.Host.Tests/Core/TestSetupWizard.cs b/tests/Tgstation.Server.Host.Tests/Core/TestSetupWizard.cs index 5624fc0728..55e06d42ef 100644 --- a/tests/Tgstation.Server.Host.Tests/Core/TestSetupWizard.cs +++ b/tests/Tgstation.Server.Host.Tests/Core/TestSetupWizard.cs @@ -12,6 +12,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Configuration; +using Tgstation.Server.Host.Database; using Tgstation.Server.Host.IO; using Tgstation.Server.Host.System; diff --git a/tests/Tgstation.Server.Host.Tests/Core/TestDatabaseConnectionFactory.cs b/tests/Tgstation.Server.Host.Tests/Database/TestDatabaseConnectionFactory.cs similarity index 95% rename from tests/Tgstation.Server.Host.Tests/Core/TestDatabaseConnectionFactory.cs rename to tests/Tgstation.Server.Host.Tests/Database/TestDatabaseConnectionFactory.cs index 516813e0a1..c95662427b 100644 --- a/tests/Tgstation.Server.Host.Tests/Core/TestDatabaseConnectionFactory.cs +++ b/tests/Tgstation.Server.Host.Tests/Database/TestDatabaseConnectionFactory.cs @@ -4,7 +4,7 @@ using System; using System.Data.SqlClient; using Tgstation.Server.Host.Configuration; -namespace Tgstation.Server.Host.Core.Tests +namespace Tgstation.Server.Host.Database.Tests { [TestClass] public sealed class TestDatabaseConnectionFactory diff --git a/tests/Tgstation.Server.Host.Tests/Core/TestDatabaseContextFactory.cs b/tests/Tgstation.Server.Host.Tests/Database/TestDatabaseContextFactory.cs similarity index 97% rename from tests/Tgstation.Server.Host.Tests/Core/TestDatabaseContextFactory.cs rename to tests/Tgstation.Server.Host.Tests/Database/TestDatabaseContextFactory.cs index 7585c8a300..14e96f8316 100644 --- a/tests/Tgstation.Server.Host.Tests/Core/TestDatabaseContextFactory.cs +++ b/tests/Tgstation.Server.Host.Tests/Database/TestDatabaseContextFactory.cs @@ -5,7 +5,7 @@ using System; using System.Threading.Tasks; using Tgstation.Server.Host.Models; -namespace Tgstation.Server.Host.Core.Tests +namespace Tgstation.Server.Host.Database.Tests { [TestClass] public sealed class TestDatabaseContextFactory