Add heartbeat backwards migration

This commit is contained in:
Jordan Brown
2020-05-11 12:18:13 -04:00
parent 20dc731b48
commit fbd8d4d23f
@@ -348,30 +348,12 @@ namespace Tgstation.Server.Host.Database
if (version < new Version(4, 0))
throw new ArgumentOutOfRangeException(nameof(version), version, "Not a valid V4 version!");
string targetMigration = null;
// Update this with new migrations as they are made
// Always use the MS class
if (version < new Version(4, 0, 2))
{
// Special handling because this is where SQLite was introduced
if (DatabaseType == DatabaseType.Sqlite)
throw new NotSupportedException("Cannot migrate below version 4.0.2.0 while using Sqlite!");
targetMigration = nameof(MSReattachCompileJobRequired);
}
// Uncomment once next migration/version step happens
/*
else if (version < new Version(V_NEXT_MIGRATION))
{
// Special handling because this is where SQLite was introduced
if (DatabaseType == DatabaseType.Sqlite)
targetMigration = nameof(SLAddSqlite);
targetMigration = nameof(V_NEXT_LAST_MIGRATION);
}
*/
string targetMigration = null;
if (version < new Version(4, 1, 0))
throw new NotSupportedException("Cannot migrate below version 4.1.0!");
else if (version < new Version(4, 2, 0))
targetMigration = DatabaseType == DatabaseType.Sqlite ? nameof(SLRebuild) : nameof(MSFixCascadingDelete);
if (targetMigration == null)
{