diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-05-18 12:58:05 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-05-18 12:58:05 -0500 |
| commit | 7a44729293863b494fd929b91f349f47b8603e7c (patch) | |
| tree | 88ef217b9b468a26b7dbf65b06524f53ba708219 /src | |
| parent | 4efad204276f9f9e1896f25c5c7c4d7aa06b4260 (diff) | |
| download | slskd-7a44729293863b494fd929b91f349f47b8603e7c.tar.gz | |
migrations -> backups
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Data/Migrator.cs | 6 | ||||
| -rw-r--r-- | src/slskd/Program.cs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/slskd/Core/Data/Migrator.cs b/src/slskd/Core/Data/Migrator.cs index 4adc22fb..4cc56147 100644 --- a/src/slskd/Core/Data/Migrator.cs +++ b/src/slskd/Core/Data/Migrator.cs @@ -59,7 +59,6 @@ public class Migrator Databases = databases; } - private string HistoryFileName { get; } = Path.Combine(Program.DataMigrationsDirectory, "history"); private IEnumerable<string> Databases { get; } private ILogger Log { get; } = Serilog.Log.ForContext<Migrator>(); @@ -94,7 +93,8 @@ public class Migrator { foreach (var migration in Migrations.Keys) { - if (!Migrations[migration].NeedsToBeApplied()) // warning: performs I/O + // warning: performs I/O + if (!Migrations[migration].NeedsToBeApplied()) { Log.Debug("Migration {Name} does not need to be applied", migration); migrationsToSkip.Add(migration); @@ -227,5 +227,5 @@ public class Migrator } private string MakeSourceDatabasePath(string database) => Path.Combine(Program.DataDirectory, $"{database}.db"); - private string MakeBackupDatabasePath(string database, string timestamp) => Path.Combine(Program.DataMigrationsDirectory, $"{database}.pre-migration-backup.{timestamp}.db"); + private string MakeBackupDatabasePath(string database, string timestamp) => Path.Combine(Program.DataBackupDirectory, $"{database}.pre-migration-backup.{timestamp}.db"); }
\ No newline at end of file diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 844d8a27..0537824f 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -188,9 +188,9 @@ namespace slskd public static string DataDirectory { get; private set; } = null; /// <summary> - /// Gets the path where database migration information is saved. + /// Gets the path where backups of persistent data saved. /// </summary> - public static string DataMigrationsDirectory { get; private set; } = null; + public static string DataBackupDirectory { get; private set; } = null; /// <summary> /// Gets the default fully qualified path to the configuration file. @@ -341,7 +341,7 @@ namespace slskd // derive the application directory value and defaults that are dependent upon it AppDirectory ??= DefaultAppDirectory; DataDirectory = Path.Combine(AppDirectory, "data"); - DataMigrationsDirectory = Path.Combine(DataDirectory, "migrations"); + DataBackupDirectory = Path.Combine(DataDirectory, "backups"); LogDirectory = Path.Combine(AppDirectory, "logs"); ScriptDirectory = Path.Combine(AppDirectory, "scripts"); @@ -359,7 +359,7 @@ namespace slskd { VerifyDirectory(AppDirectory, createIfMissing: true, verifyWriteable: true); VerifyDirectory(DataDirectory, createIfMissing: true, verifyWriteable: true); - VerifyDirectory(DataMigrationsDirectory, createIfMissing: true, verifyWriteable: true); + VerifyDirectory(DataBackupDirectory, createIfMissing: true, verifyWriteable: true); VerifyDirectory(ScriptDirectory, createIfMissing: true, verifyWriteable: false); VerifyDirectory(DefaultDownloadsDirectory, createIfMissing: true, verifyWriteable: true); VerifyDirectory(DefaultIncompleteDirectory, createIfMissing: true, verifyWriteable: true); |
