tgstation-server 6.1.2
The /tg/station 13 server suite
Loading...
Searching...
No Matches
DatabaseContext.cs
Go to the documentation of this file.
1using System;
2using System.Globalization;
3using System.Linq;
4using System.Reflection;
5using System.Threading;
6using System.Threading.Tasks;
7
8using Microsoft.EntityFrameworkCore;
9using Microsoft.EntityFrameworkCore.Infrastructure;
10using Microsoft.EntityFrameworkCore.Migrations;
11using Microsoft.Extensions.DependencyInjection;
12using Microsoft.Extensions.Logging;
13
17
19{
23#pragma warning disable CA1506 // TODO: Decomplexify
25 {
29 public DbSet<User> Users { get; set; }
30
34 public DbSet<Instance> Instances { get; set; }
35
39 public DbSet<CompileJob> CompileJobs { get; set; }
40
44 public DbSet<RevisionInformation> RevisionInformations { get; set; }
45
49 public DbSet<DreamMakerSettings> DreamMakerSettings { get; set; }
50
54 public DbSet<ChatBot> ChatBots { get; set; }
55
59 public DbSet<DreamDaemonSettings> DreamDaemonSettings { get; set; }
60
64 public DbSet<RepositorySettings> RepositorySettings { get; set; }
65
69 public DbSet<InstancePermissionSet> InstancePermissionSets { get; set; }
70
74 public DbSet<ChatChannel> ChatChannels { get; set; }
75
79 public DbSet<Job> Jobs { get; set; }
80
84 public DbSet<ReattachInformation> ReattachInformations { get; set; }
85
89 public DbSet<TestMerge> TestMerges { get; set; }
90
94 public DbSet<RevInfoTestMerge> RevInfoTestMerges { get; set; }
95
99 public DbSet<OAuthConnection> OAuthConnections { get; set; }
100
104 public DbSet<PermissionSet> PermissionSets { get; set; }
105
109 public DbSet<UserGroup> Groups { get; set; }
110
113
116
119
121 IDatabaseCollection<Job> IDatabaseContext.Jobs => jobsCollection;
122
125
128
131
134
137
140
143
146
148 IDatabaseCollection<OAuthConnection> IDatabaseContext.OAuthConnections => oAuthConnections;
149
151 IDatabaseCollection<UserGroup> IDatabaseContext.Groups => groups;
152
154 IDatabaseCollection<PermissionSet> IDatabaseContext.PermissionSets => permissionSets;
155
159 protected virtual DeleteBehavior RevInfoCompileJobDeleteBehavior => DeleteBehavior.ClientNoAction;
160
165
170
175
180
185
190
195
200
205
210
215
220
225
230
235
241 public static Action<DbContextOptionsBuilder, DatabaseConfiguration> GetConfigureAction<TDatabaseContext>()
242 where TDatabaseContext : DatabaseContext
243 {
244 // HACK HACK HACK HACK HACK
245 const string ConfigureMethodName = nameof(SqlServerDatabaseContext.ConfigureWith);
246 var configureFunction = typeof(TDatabaseContext).GetMethod(
247 ConfigureMethodName,
248 BindingFlags.Public | BindingFlags.Static)
249 ?? throw new InvalidOperationException($"Context type {typeof(TDatabaseContext).FullName} missing static {ConfigureMethodName} function!");
250 return (optionsBuilder, config) => configureFunction.Invoke(null, new object[] { optionsBuilder, config });
251 }
252
257 protected DatabaseContext(DbContextOptions dbContextOptions)
258 : base(dbContextOptions)
259 {
275 }
276
278 public Task Save(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);
279
281 public Task Drop(CancellationToken cancellationToken) => Database.EnsureDeletedAsync(cancellationToken);
282
284 public async ValueTask<bool> Migrate(ILogger<DatabaseContext> logger, CancellationToken cancellationToken)
285 {
286 ArgumentNullException.ThrowIfNull(logger);
287 var migrations = await Database.GetAppliedMigrationsAsync(cancellationToken);
288 var wasEmpty = !migrations.Any();
289
290 if (wasEmpty || (await Database.GetPendingMigrationsAsync(cancellationToken)).Any())
291 {
292 logger.LogInformation("Migrating database...");
293 await Database.MigrateAsync(cancellationToken);
294 }
295 else
296 logger.LogDebug("No migrations to apply");
297
298 wasEmpty |= !await Users.AsQueryable().AnyAsync(cancellationToken);
299
300 return wasEmpty;
301 }
302
304 protected override void OnModelCreating(ModelBuilder modelBuilder)
305 {
306 ArgumentNullException.ThrowIfNull(modelBuilder);
307
308 base.OnModelCreating(modelBuilder);
309
310 var userModel = modelBuilder.Entity<User>();
311 userModel.HasIndex(x => x.CanonicalName).IsUnique();
312 userModel.HasIndex(x => x.SystemIdentifier).IsUnique();
313 userModel.HasMany(x => x.TestMerges).WithOne(x => x.MergedBy).OnDelete(DeleteBehavior.Restrict);
314 userModel.HasMany(x => x.OAuthConnections).WithOne(x => x.User).OnDelete(DeleteBehavior.Cascade);
315
316 modelBuilder.Entity<OAuthConnection>().HasIndex(x => new { x.Provider, x.ExternalUserId }).IsUnique();
317
318 var groupsModel = modelBuilder.Entity<UserGroup>();
319 groupsModel.HasIndex(x => x.Name).IsUnique();
320 groupsModel.HasMany(x => x.Users).WithOne(x => x.Group).OnDelete(DeleteBehavior.ClientSetNull);
321
322 var permissionSetModel = modelBuilder.Entity<PermissionSet>();
323 permissionSetModel.HasOne(x => x.Group).WithOne(x => x.PermissionSet).OnDelete(DeleteBehavior.Cascade);
324 permissionSetModel.HasOne(x => x.User).WithOne(x => x.PermissionSet).OnDelete(DeleteBehavior.Cascade);
325 permissionSetModel.HasMany(x => x.InstancePermissionSets).WithOne(x => x.PermissionSet).OnDelete(DeleteBehavior.Cascade);
326
327 modelBuilder.Entity<InstancePermissionSet>().HasIndex(x => new { x.PermissionSetId, x.InstanceId }).IsUnique();
328
329 var revInfo = modelBuilder.Entity<RevisionInformation>();
330 revInfo.HasMany(x => x.ActiveTestMerges).WithOne(x => x.RevisionInformation).OnDelete(DeleteBehavior.Cascade);
331 revInfo.HasOne(x => x.PrimaryTestMerge).WithOne(x => x.PrimaryRevisionInformation).OnDelete(DeleteBehavior.Cascade);
332 revInfo.HasIndex(x => new { x.InstanceId, x.CommitSha }).IsUnique();
333
334 // IMPORTANT: When an instance is deleted (detached) it cascades into the maze of revinfo/testmerge/ritm/compilejob/job/ri relations
335 // This maze starts at revInfo and jobs
336 // jobs takes care of deleting compile jobs and ris
337 // rev info takes care of the rest
338 // Break the link here so the db doesn't shit itself complaining about cascading deletes
339 // EF will handle making the right query to destroy everything
340 // UPDATE: I fuck with this constantly in hopes of eliminating FK issues on instance detack
341 revInfo.HasMany(x => x.CompileJobs).WithOne(x => x.RevisionInformation).OnDelete(RevInfoCompileJobDeleteBehavior);
342
343 // Also break the link between ritm and testmerge so it doesn't cycle in a triangle with rev info
344 modelBuilder.Entity<TestMerge>().HasMany(x => x.RevisonInformations).WithOne(x => x.TestMerge).OnDelete(DeleteBehavior.ClientNoAction);
345
346 var compileJob = modelBuilder.Entity<CompileJob>();
347 compileJob.HasIndex(x => x.DirectoryName);
348 compileJob.HasOne(x => x.Job).WithOne().OnDelete(DeleteBehavior.Cascade);
349
350 modelBuilder.Entity<ReattachInformation>().HasOne(x => x.CompileJob).WithMany().OnDelete(DeleteBehavior.Cascade);
351
352 var chatChannel = modelBuilder.Entity<ChatChannel>();
353 chatChannel.HasIndex(x => new { x.ChatSettingsId, x.IrcChannel }).IsUnique();
354 chatChannel.HasIndex(x => new { x.ChatSettingsId, x.DiscordChannelId }).IsUnique();
355 chatChannel.HasOne(x => x.ChatSettings).WithMany(x => x.Channels).HasForeignKey(x => x.ChatSettingsId).OnDelete(DeleteBehavior.Cascade);
356
357 modelBuilder.Entity<ChatBot>().HasIndex(x => new { x.InstanceId, x.Name }).IsUnique();
358
359 var instanceModel = modelBuilder.Entity<Instance>();
360 instanceModel.HasIndex(x => new { x.Path, x.SwarmIdentifer }).IsUnique();
361 instanceModel.HasMany(x => x.ChatSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
362 instanceModel.HasOne(x => x.DreamDaemonSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
363 instanceModel.HasOne(x => x.DreamMakerSettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
364 instanceModel.HasOne(x => x.RepositorySettings).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
365 instanceModel.HasMany(x => x.RevisionInformations).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
366 instanceModel.HasMany(x => x.InstancePermissionSets).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
367 instanceModel.HasMany(x => x.Jobs).WithOne(x => x.Instance).OnDelete(DeleteBehavior.Cascade);
368 }
369
370 // HEY YOU
371 // IF YOU HAVE A TEST THAT'S CREATING ERRORS BECAUSE THESE VALUES AREN'T SET CORRECTLY THERE'S MORE TO FIXING IT THAN JUST UPDATING THEM
372 // IN THE FUNCTION BELOW YOU ALSO NEED TO CORRECTLY SET THE RIGHT MIGRATION TO DOWNGRADE TO FOR THE LAST TGS VERSION
373 // IF THIS BREAKS AGAIN I WILL PERSONALLY HAUNT YOUR ASS WHEN I DIE
374
378 internal static readonly Type MSLatestMigration = typeof(MSAddTopicPort);
379
383 internal static readonly Type MYLatestMigration = typeof(MYAddTopicPort);
384
388 internal static readonly Type PGLatestMigration = typeof(PGAddTopicPort);
389
393 internal static readonly Type SLLatestMigration = typeof(SLAddTopicPort);
394
396#pragma warning disable CA1502 // Cyclomatic complexity
397 public async ValueTask SchemaDowngradeForServerVersion(
398 ILogger<DatabaseContext> logger,
399 Version targetVersion,
400 DatabaseType currentDatabaseType,
401 CancellationToken cancellationToken)
402 {
403 ArgumentNullException.ThrowIfNull(logger);
404 ArgumentNullException.ThrowIfNull(targetVersion);
405 if (targetVersion < new Version(4, 0))
406 throw new ArgumentOutOfRangeException(nameof(targetVersion), targetVersion, "Cannot migrate below version 4.0.0!");
407
408 if (currentDatabaseType == DatabaseType.PostgresSql && targetVersion < new Version(4, 3, 0))
409 throw new NotSupportedException("Cannot migrate below version 4.3.0 with PostgresSql!");
410
411 if (currentDatabaseType == DatabaseType.MariaDB)
412 currentDatabaseType = DatabaseType.MySql; // Keeping switch expressions while avoiding `or` syntax from C#9
413
414 if (targetVersion < new Version(4, 1, 0))
415 throw new NotSupportedException("Cannot migrate below version 4.1.0!");
416
417 // Update this with new migrations as they are made
418 string? targetMigration = null;
419
420 string BadDatabaseType() => throw new ArgumentException($"Invalid DatabaseType: {currentDatabaseType}", nameof(currentDatabaseType));
421
422 if (targetVersion < new Version(6, 0, 0))
423 targetMigration = currentDatabaseType switch
424 {
425 DatabaseType.MySql => nameof(MYAddJobCodes),
426 DatabaseType.PostgresSql => nameof(PGAddJobCodes),
427 DatabaseType.SqlServer => nameof(MSAddJobCodes),
428 DatabaseType.Sqlite => nameof(SLAddJobCodes),
429 _ => BadDatabaseType(),
430 };
431 if (targetVersion < new Version(5, 17, 0))
432 targetMigration = currentDatabaseType switch
433 {
434 DatabaseType.MySql => nameof(MYAddMapThreads),
435 DatabaseType.PostgresSql => nameof(PGAddMapThreads),
436 DatabaseType.SqlServer => nameof(MSAddMapThreads),
437 DatabaseType.Sqlite => nameof(SLAddMapThreads),
438 _ => BadDatabaseType(),
439 };
440 if (targetVersion < new Version(5, 13, 0))
441 targetMigration = currentDatabaseType switch
442 {
443 DatabaseType.MySql => nameof(MYAddReattachInfoInitialCompileJob),
444 DatabaseType.PostgresSql => nameof(PGAddReattachInfoInitialCompileJob),
445 DatabaseType.SqlServer => nameof(MSAddReattachInfoInitialCompileJob),
446 DatabaseType.Sqlite => nameof(SLAddReattachInfoInitialCompileJob),
447 _ => BadDatabaseType(),
448 };
449 if (targetVersion < new Version(5, 7, 3))
450 targetMigration = currentDatabaseType switch
451 {
452 DatabaseType.MySql => nameof(MYAddDreamDaemonLogOutput),
453 DatabaseType.PostgresSql => nameof(PGAddDreamDaemonLogOutput),
454 DatabaseType.SqlServer => nameof(MSAddDreamDaemonLogOutput),
455 DatabaseType.Sqlite => nameof(SLAddDreamDaemonLogOutput),
456 _ => BadDatabaseType(),
457 };
458 if (targetVersion < new Version(5, 7, 0))
459 targetMigration = currentDatabaseType switch
460 {
461 DatabaseType.MySql => nameof(MYAddProfiler),
462 DatabaseType.PostgresSql => nameof(PGAddProfiler),
463 DatabaseType.SqlServer => nameof(MSAddProfiler),
464 DatabaseType.Sqlite => nameof(SLAddProfiler),
465 _ => BadDatabaseType(),
466 };
467 if (targetVersion < new Version(4, 19, 0))
468 targetMigration = currentDatabaseType switch
469 {
470 DatabaseType.MySql => nameof(MYAddDumpOnHeartbeatRestart),
471 DatabaseType.PostgresSql => nameof(PGAddDumpOnHeartbeatRestart),
472 DatabaseType.SqlServer => nameof(MSAddDumpOnHeartbeatRestart),
473 DatabaseType.Sqlite => nameof(SLAddDumpOnHeartbeatRestart),
474 _ => BadDatabaseType(),
475 };
476 if (targetVersion < new Version(4, 18, 0))
477 targetMigration = currentDatabaseType switch
478 {
479 DatabaseType.MySql => nameof(MYAddUpdateSubmodules),
480 DatabaseType.PostgresSql => nameof(PGAddUpdateSubmodules),
481 DatabaseType.SqlServer => nameof(MSAddUpdateSubmodules),
482 DatabaseType.Sqlite => nameof(SLAddUpdateSubmodules),
483 _ => BadDatabaseType(),
484 };
485 if (targetVersion < new Version(4, 14, 0))
486 targetMigration = currentDatabaseType switch
487 {
488 DatabaseType.MySql => nameof(MYTruncateInstanceNames),
489 DatabaseType.PostgresSql => nameof(PGTruncateInstanceNames),
490 DatabaseType.SqlServer => nameof(MSTruncateInstanceNames),
491 DatabaseType.Sqlite => nameof(SLAddRevInfoTimestamp),
492 _ => BadDatabaseType(),
493 };
494 if (targetVersion < new Version(4, 10, 0))
495 targetMigration = currentDatabaseType switch
496 {
497 DatabaseType.MySql => nameof(MSAddRevInfoTimestamp),
498 DatabaseType.PostgresSql => nameof(PGAddRevInfoTimestamp),
499 DatabaseType.SqlServer => nameof(MSAddRevInfoTimestamp),
500 DatabaseType.Sqlite => nameof(SLAddRevInfoTimestamp),
501 _ => BadDatabaseType(),
502 };
503 if (targetVersion < new Version(4, 8, 0))
504 targetMigration = currentDatabaseType switch
505 {
506 DatabaseType.MySql => nameof(MYAddSwarmIdentifer),
507 DatabaseType.PostgresSql => nameof(PGAddSwarmIdentifer),
508 DatabaseType.SqlServer => nameof(MSAddSwarmIdentifer),
509 DatabaseType.Sqlite => nameof(SLAddSwarmIdentifer),
510 _ => BadDatabaseType(),
511 };
512 if (targetVersion < new Version(4, 7, 0))
513 targetMigration = currentDatabaseType switch
514 {
515 DatabaseType.MySql => nameof(MYAddAdditionalDDParameters),
516 DatabaseType.PostgresSql => nameof(PGAddAdditionalDDParameters),
517 DatabaseType.SqlServer => nameof(MSAddAdditionalDDParameters),
518 DatabaseType.Sqlite => nameof(SLAddAdditionalDDParameters),
519 _ => BadDatabaseType(),
520 };
521 if (targetVersion < new Version(4, 6, 0))
522 targetMigration = currentDatabaseType switch
523 {
524 DatabaseType.MySql => nameof(MYAddDeploymentColumns),
525 DatabaseType.PostgresSql => nameof(PGAddDeploymentColumns),
526 DatabaseType.SqlServer => nameof(MSAddDeploymentColumns),
527 DatabaseType.Sqlite => nameof(SLAddDeploymentColumns),
528 _ => BadDatabaseType(),
529 };
530 if (targetVersion < new Version(4, 5, 0))
531 targetMigration = currentDatabaseType switch
532 {
533 DatabaseType.MySql => nameof(MYAllowNullDMApi),
534 DatabaseType.PostgresSql => nameof(PGAllowNullDMApi),
535 DatabaseType.SqlServer => nameof(MSAllowNullDMApi),
536 DatabaseType.Sqlite => nameof(SLAllowNullDMApi),
537 _ => BadDatabaseType(),
538 };
539 if (targetVersion < new Version(4, 4, 0))
540 targetMigration = currentDatabaseType switch
541 {
542 DatabaseType.MySql => nameof(MYFixForeignKey),
543 DatabaseType.PostgresSql => nameof(PGCreate),
544 DatabaseType.SqlServer => nameof(MSRemoveSoftColumns),
545 DatabaseType.Sqlite => nameof(SLRemoveSoftColumns),
546 _ => BadDatabaseType(),
547 };
548 if (targetVersion < new Version(4, 2, 0))
549 targetMigration = currentDatabaseType == DatabaseType.Sqlite ? nameof(SLRebuild) : nameof(MSFixCascadingDelete);
550
551 if (targetMigration == null)
552 {
553 logger.LogDebug("No down migration required.");
554 return;
555 }
556
557 // already setup
558 var migrationSubstitution = currentDatabaseType switch
559 {
560 DatabaseType.SqlServer => null, // already setup
561 DatabaseType.MySql => "MY{0}",
562 DatabaseType.Sqlite => "SL{0}",
563 DatabaseType.PostgresSql => "PG{0}",
564 _ => throw new InvalidOperationException($"Invalid DatabaseType: {currentDatabaseType}"),
565 };
566
567 if (migrationSubstitution != null)
568 targetMigration = String.Format(CultureInfo.InvariantCulture, migrationSubstitution, targetMigration[2..]);
569
570 // even though it clearly implements it in the DatabaseFacade definition this won't work without casting (╯ಠ益ಠ)╯︵ ┻━┻
571 var dbServiceProvider = ((IInfrastructure<IServiceProvider>)Database).Instance;
572 var migrator = dbServiceProvider.GetRequiredService<IMigrator>();
573
574 logger.LogInformation("Migrating down to version {targetVersion}. Target: {targetMigration}", targetVersion, targetMigration);
575 try
576 {
577 await migrator.MigrateAsync(targetMigration, cancellationToken);
578 }
579 catch (Exception e)
580 {
581 logger.LogCritical(e, "Failed to migrate!");
582 }
583 }
584#pragma warning restore CA1502 // Cyclomatic complexity
585 }
586}
Backend abstract implementation of IDatabaseContext.
DbSet< ReattachInformation > ReattachInformations
The ReattachInformations in the DatabaseContext.
readonly IDatabaseCollection< UserGroup > groups
Backing field for IDatabaseContext.Groups.
DbSet< Job > Jobs
The Jobs in the DatabaseContext.
DbSet< Instance > Instances
The Instances in the DatabaseContext.
readonly IDatabaseCollection< DreamMakerSettings > dreamMakerSettingsCollection
Backing field for IDatabaseContext.DreamMakerSettings.
virtual DeleteBehavior RevInfoCompileJobDeleteBehavior
The DeleteBehavior for the CompileJob/RevisionInformation foreign key.
readonly IDatabaseCollection< RepositorySettings > repositorySettingsCollection
Backing field for IDatabaseContext.RepositorySettings.
DbSet< OAuthConnection > OAuthConnections
The OAuthConnections in the DatabaseContext.
readonly IDatabaseCollection< User > usersCollection
Backing field for IDatabaseContext.Users.
readonly IDatabaseCollection< Job > jobsCollection
Backing field for IDatabaseContext.Jobs.
override void OnModelCreating(ModelBuilder modelBuilder)
DbSet< ChatChannel > ChatChannels
The ChatChannels in the DatabaseContext.
DatabaseContext(DbContextOptions dbContextOptions)
Initializes a new instance of the DatabaseContext class.
readonly IDatabaseCollection< DreamDaemonSettings > dreamDaemonSettingsCollection
Backing field for IDatabaseContext.DreamDaemonSettings.
readonly IDatabaseCollection< Instance > instancesCollection
Backing field for IDatabaseContext.Instances.
DbSet< InstancePermissionSet > InstancePermissionSets
The InstancePermissionSets in the DatabaseContext.
DbSet< PermissionSet > PermissionSets
The PermissionSets in the DatabaseContext.
readonly IDatabaseCollection< ChatChannel > chatChannelsCollection
Backing field for IDatabaseContext.ChatChannels.
DbSet< CompileJob > CompileJobs
The CompileJobs in the DatabaseContext.
async ValueTask< bool > Migrate(ILogger< DatabaseContext > logger, CancellationToken cancellationToken)
Creates and migrates the IDatabaseContext. A ValueTask<TResult> resulting in true if the database sho...
readonly IDatabaseCollection< RevisionInformation > revisionInformationsCollection
Backing field for IDatabaseContext.RevisionInformations.
DbSet< TestMerge > TestMerges
The TestMerges in the DatabaseContext.
async ValueTask SchemaDowngradeForServerVersion(ILogger< DatabaseContext > logger, Version targetVersion, DatabaseType currentDatabaseType, CancellationToken cancellationToken)
Attempt to downgrade the schema to the migration used for a given server targetVersion ....
readonly IDatabaseCollection< InstancePermissionSet > instancePermissionSetsCollection
Backing field for IDatabaseContext.InstancePermissionSets.
Task Drop(CancellationToken cancellationToken)
Attempts to delete all tables and drop the database in use. A Task representing the running operation...
readonly IDatabaseCollection< ReattachInformation > reattachInformationsCollection
Backing field for IDatabaseContext.ReattachInformations.
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext. A Task representing the running operation.
readonly IDatabaseCollection< PermissionSet > permissionSets
Backing field for IDatabaseContext.PermissionSets.
readonly IDatabaseCollection< ChatBot > chatBotsCollection
Backing field for IDatabaseContext.ChatBots.
readonly IDatabaseCollection< CompileJob > compileJobsCollection
Backing field for IDatabaseContext.CompileJobs.
DbSet< User > Users
The Users in the DatabaseContext.
DbSet< ChatBot > ChatBots
The ChatBots in the DatabaseContext.
DbSet< RevInfoTestMerge > RevInfoTestMerges
The RevInfoTestMerges in the DatabaseContext.
readonly IDatabaseCollection< OAuthConnection > oAuthConnections
Backing field for IDatabaseContext.OAuthConnections.
static Action< DbContextOptionsBuilder, DatabaseConfiguration > GetConfigureAction< TDatabaseContext >()
Gets the configure action for a given TDatabaseContext .
DbSet< RevisionInformation > RevisionInformations
The RevisionInformations in the DatabaseContext.
DbSet< UserGroup > Groups
The UserGroups in the DatabaseContext.
Adds the DreamMakerSettings DumpOnHeartbeatRestart column for MSSQL.
Adds the MapThreads DreamDaemonSettings column for MSSQL.
Adds the option to start the profiler with DreamDaemon for MSSQL.
Add the Timestamp column to RevisionInformations for MSSQL.
Update models for making the DMAPI optional for MSSQL.
Fix cascading data deletes for Models.Instances on MSSQL.
Adds the DreamMakerSettings DumpOnHeartbeatRestart column for MYSQL.
Adds the MapThreads DreamDaemonSettings column for MYSQL.
Adds the option to start the profiler with DreamDaemon for MYSQL.
Update models for making the DMAPI optional for MYSQL.
Fix the CompileJob/RevisionInformation foreign key for MySQL.
Adds the DreamMakerSettings DumpOnHeartbeatRestart column for PostgresSQL.
Adds the MapThreads DreamDaemonSettings column for PostgresSQL.
Adds the option to start the profiler with DreamDaemon for PostgresSQL.
Adds the InitialCompileJobId to the ReattachInformations table for PostgresSQL.
Add the Timestamp column to RevisionInformations for PostgresSQL.
Adds the UpdateSubmodules repository setting for PostgresSQL.
Update models for making the DMAPI optional for PostgresSQL.
Adds the DreamMakerSettings DumpOnHeartbeatRestart column for SQLite.
Adds the MapThreads DreamDaemonSettings column for SQLite.
Adds the option to start the profiler with DreamDaemon for SQLite.
Add the Timestamp column to RevisionInformations for SQLite.
Update models for making the DMAPI optional for SQLite.
static void ConfigureWith(DbContextOptionsBuilder options, DatabaseConfiguration databaseConfiguration)
Configure the SqlServerDatabaseContext.
Represents an Api.Models.Instance in the database.
Definition: Instance.cs:11
Database representation of Components.Session.ReattachInformation.
Represents a group of Users.
Definition: UserGroup.cs:15
DatabaseType
Type of database to user.
Definition: DatabaseType.cs:7