1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-30 13:33:24 +01:00
bitwarden-server/util/Migrator/SqlServerDbMigrator.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
712 B
C#
Raw Normal View History

using Bit.Core.Settings;
using Bit.Core.Utilities;
using Microsoft.Extensions.Logging;
namespace Bit.Migrator;
public class SqlServerDbMigrator : IDbMigrator
{
private readonly DbMigrator _migrator;
public SqlServerDbMigrator(GlobalSettings globalSettings, ILogger<DbMigrator> logger)
{
_migrator = new DbMigrator(globalSettings.SqlServer.ConnectionString, logger,
globalSettings.SqlServer.SkipDatabasePreparation);
}
public bool MigrateDatabase(bool enableLogging = true,
CancellationToken cancellationToken = default)
{
return _migrator.MigrateMsSqlDatabaseWithRetries(enableLogging,
cancellationToken: cancellationToken);
}
}