Skip to content

Commit

Permalink
Fix migration tests issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Jan 2, 2025
1 parent 8d9bb24 commit 66b8d57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<TgsDmapiVersion>7.3.1</TgsDmapiVersion>
<TgsInteropVersion>5.10.0</TgsInteropVersion>
<TgsHostWatchdogVersion>1.6.0</TgsHostWatchdogVersion>
<TgsSwarmProtocolVersion>8.0.0</TgsSwarmProtocolVersion>
<TgsSwarmProtocolVersion>9.0.0</TgsSwarmProtocolVersion>
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
<TgsNetMajorVersion>8</TgsNetMajorVersion>
Expand Down
5 changes: 4 additions & 1 deletion src/Tgstation.Server.Host/Database/DatabaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
/// <summary>
/// Used by unit tests to remind us to setup the correct SQLite migration downgrades.
/// </summary>
internal static readonly Type SLLatestMigration = typeof(SLAddAutoStartAndStop);
internal static readonly Type SLLatestMigration = typeof(SLNormalizeSqlite);

/// <summary>
/// Gets the name of the migration to run for migrating down to a given <paramref name="targetVersion"/> for the <paramref name="currentDatabaseType"/>.
Expand All @@ -482,6 +482,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
string BadDatabaseType() => throw new ArgumentException($"Invalid DatabaseType: {currentDatabaseType}", nameof(currentDatabaseType));

// !!! DON'T FORGET TO UPDATE THE SWARM PROTOCOL MAJOR VERSION !!!
if (targetVersion < new Version(6, 13, 0) && currentDatabaseType == DatabaseType.Sqlite)
targetMigration = nameof(SLAddAutoStartAndStop);

if (targetVersion < new Version(6, 12, 0))
targetMigration = currentDatabaseType switch
{
Expand Down

0 comments on commit 66b8d57

Please sign in to comment.