avoid bumping mtime when correcting card eases on upgrade

The USN is still set, which should cause the cards to sync in the
non-conflict case, but if changes have been made on other devices
the ease fix will not take priority, as we could be overwriting the
reviews of someone who has not synced in a while.
This commit is contained in:
Damien Elmes 2021-01-28 08:11:35 +10:00
parent d63bc24c0d
commit 3988010aa2
2 changed files with 10 additions and 13 deletions

View file

@ -1,10 +1,9 @@
update cards UPDATE cards
set factor = 2500, SET factor = 2500,
usn = ?, usn = ?
mod = ? WHERE factor != 0
where factor != 0 AND factor <= 2000
and factor <= 2000 AND (
and ( did IN DECK_IDS
did in DECK_IDS OR odid IN DECK_IDS
or odid in DECK_IDS
) )

View file

@ -404,9 +404,7 @@ impl super::SqliteStorage {
ids_to_string(&mut ids, &affected_decks); ids_to_string(&mut ids, &affected_decks);
let sql = include_str!("fix_low_ease.sql").replace("DECK_IDS", &ids); let sql = include_str!("fix_low_ease.sql").replace("DECK_IDS", &ids);
self.db self.db.prepare(&sql)?.execute(params![self.usn(server)?])?;
.prepare(&sql)?
.execute(params![self.usn(server)?, TimestampSecs::now()])?;
Ok(()) Ok(())
} }