repo/sqlite: don't update tas info without changes
This commit is contained in:
parent
aec7116651
commit
132ad3adf8
1 changed files with 7 additions and 1 deletions
|
@ -251,7 +251,7 @@ impl SqliteRepo {
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! run_migration {
|
macro_rules! run_migration {
|
||||||
($this:ident, $ver:ident = $version:expr) => {
|
($this:ident, $ver:ident = $version:literal) => {
|
||||||
$this
|
$this
|
||||||
.conn
|
.conn
|
||||||
.execute_batch(&format!(
|
.execute_batch(&format!(
|
||||||
|
@ -288,9 +288,15 @@ impl std::fmt::Display for MigrationError {
|
||||||
|
|
||||||
impl std::error::Error for MigrationError {}
|
impl std::error::Error for MigrationError {}
|
||||||
|
|
||||||
|
const LATEST_VERSION: i64 = 202208162308;
|
||||||
|
|
||||||
impl SqliteRepo {
|
impl SqliteRepo {
|
||||||
pub fn upgrade(&self) -> Result<(), MigrationError> {
|
pub fn upgrade(&self) -> Result<(), MigrationError> {
|
||||||
let mut version = self.version();
|
let mut version = self.version();
|
||||||
|
if version == Some(LATEST_VERSION) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
if version.is_none() {
|
if version.is_none() {
|
||||||
run_migration!(self, version = 202208162308);
|
run_migration!(self, version = 202208162308);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue