diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Migrations/TransferStateMigration_04012025.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/slskd/Core/Migrations/TransferStateMigration_04012025.cs b/src/slskd/Core/Migrations/TransferStateMigration_04012025.cs index 6b03567a..ea295851 100644 --- a/src/slskd/Core/Migrations/TransferStateMigration_04012025.cs +++ b/src/slskd/Core/Migrations/TransferStateMigration_04012025.cs @@ -18,14 +18,21 @@ namespace slskd.Migrations; using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using Microsoft.Data.Sqlite; public class TransferStateMigration_04012025 : IMigration { - public void Apply() - { + private string DbName => "transfers"; + public void Apply(IEnumerable<string> databases) + { + if (!databases.Contains(DbName)) + { + throw new SlskdException($"Attempting to migrate database {DbName} but {DbName} is not in the list of known databases ({string.Join(",", databases)}). This is a precautionary check to ensure databases are properly backed up prior to migration, and the check has failed. Only an application update can fix this; please create an urgent issue: {Program.IssuesUrl}"); + } } static void AddStateDescriptionColumn(string dbPath) |
