Skip to content

Commit

Permalink
Adjust migrator syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Sep 2, 2024
1 parent d9e470e commit 914f016
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions crates/bitwarden-db/src/migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,14 @@ impl Migrator {
for migration in migrations {
info!("Applying migration: {}", migration.description);

match current_version < target_version {
true => {
db.execute_batch(migration.up)
.await
.map_err(|_| MigratorError::MigrationFailed)?;
}
false => {
db.execute_batch(migration.down)
.await
.map_err(|_| MigratorError::MigrationFailed)?;
}
if current_version < target_version {
db.execute_batch(migration.up)
.await

Check warning on line 57 in crates/bitwarden-db/src/migrator.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-db/src/migrator.rs#L57

Added line #L57 was not covered by tests
.map_err(|_| MigratorError::MigrationFailed)?;
} else {
db.execute_batch(migration.down)
.await
.map_err(|_| MigratorError::MigrationFailed)?;

Check warning on line 62 in crates/bitwarden-db/src/migrator.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-db/src/migrator.rs#L60-L62

Added lines #L60 - L62 were not covered by tests
}
}

Expand Down

0 comments on commit 914f016

Please sign in to comment.