fix clippy performance and sus warnings, remove 1 unwrap, forgot to increment db version

Signed-off-by: strawberry <strawberry@pupbrain.dev>
This commit is contained in:
strawberry 2023-11-25 23:20:13 -05:00 committed by strawberry
parent b4e2f7ca37
commit 2dc1c1fdcb
7 changed files with 47 additions and 22 deletions

View file

@ -427,7 +427,14 @@ impl KeyValueDatabase {
}
// If the database has any data, perform data migrations before starting
let latest_database_version = 13;
let latest_database_version: u64;
// do not increment the db version if the user is not using sha256_media
if cfg!(feature = "sha256_media") {
latest_database_version = 14;
} else {
latest_database_version = 13;
}
if services().users.count()? > 0 {
// MIGRATIONS
@ -959,7 +966,7 @@ impl KeyValueDatabase {
}
}
services().globals.bump_database_version(13)?;
services().globals.bump_database_version(14)?;
warn!("Migration: 13 -> 14 finished");
} else {