diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-04-03 20:17:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-04-03 20:17:31 -0500 |
| commit | bc5026519568bedaf49bc7aba20458d08a8656d7 (patch) | |
| tree | c1c377296f0b8b5b2b9c80d5df2c12f15136cca3 /src | |
| parent | 5e99dd513de1eb886803495ba144ffdeaa46cd1f (diff) | |
| download | slskd-bc5026519568bedaf49bc7aba20458d08a8656d7.tar.gz | |
update signature, throw on missing database
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) |
