diff --git a/src/NzbDrone.Core/Datastore/Database.cs b/src/NzbDrone.Core/Datastore/Database.cs index 203497369..8ef429261 100644 --- a/src/NzbDrone.Core/Datastore/Database.cs +++ b/src/NzbDrone.Core/Datastore/Database.cs @@ -14,12 +14,14 @@ public interface IDatabase public class Database : IDatabase { + private readonly string _databaseName; private readonly Func _datamapperFactory; private readonly Logger _logger = NzbDroneLogger.GetLogger(typeof(Database)); - public Database(Func datamapperFactory) + public Database(string databaseName, Func datamapperFactory) { + _databaseName = databaseName; _datamapperFactory = datamapperFactory; } @@ -42,9 +44,9 @@ public void Vacuum() { try { - _logger.Info("Vacuuming database"); + _logger.Info("Vacuuming {0} database", _databaseName); _datamapperFactory().ExecuteNonQuery("Vacuum;"); - _logger.Info("Database Compressed"); + _logger.Info("{0} database compressed", _databaseName); } catch (Exception e) { diff --git a/src/NzbDrone.Core/Datastore/DbFactory.cs b/src/NzbDrone.Core/Datastore/DbFactory.cs index e4fffed2f..7b95f1d24 100644 --- a/src/NzbDrone.Core/Datastore/DbFactory.cs +++ b/src/NzbDrone.Core/Datastore/DbFactory.cs @@ -68,7 +68,7 @@ public IDatabase Create(MigrationType migrationType = MigrationType.Main, Action _migrationController.MigrateToLatest(connectionString, migrationType, beforeMigration); - var db = new Database(() => + var db = new Database(migrationType.ToString(), () => { var dataMapper = new DataMapper(SQLiteFactory.Instance, connectionString) {