repo/sqlite: don't update tas info without changes

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-20 15:53:24 +03:00
parent aec7116651
commit 132ad3adf8
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
1 changed files with 7 additions and 1 deletions

View File

@ -251,7 +251,7 @@ impl SqliteRepo {
}
macro_rules! run_migration {
($this:ident, $ver:ident = $version:expr) => {
($this:ident, $ver:ident = $version:literal) => {
$this
.conn
.execute_batch(&format!(
@ -288,9 +288,15 @@ impl std::fmt::Display for MigrationError {
impl std::error::Error for MigrationError {}
const LATEST_VERSION: i64 = 202208162308;
impl SqliteRepo {
pub fn upgrade(&self) -> Result<(), MigrationError> {
let mut version = self.version();
if version == Some(LATEST_VERSION) {
return Ok(());
}
if version.is_none() {
run_migration!(self, version = 202208162308);
}