mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
reindex when checking database
Came across a user with a corrupt index: sqlite> pragma integrity_check; integrity_check = wrong # of entries in index ix_revlog_cid integrity_check = wrong # of entries in index ix_cards_sched This is not picked up by a quick check, and a vacuum does not fix it, but a reindex does. AnkiWeb currently performs a full check when a file is uploaded to it, so this was leading to "corrupt" to show up when syncing the collection, with a local DB check not reporting/fixing the issue.
This commit is contained in:
parent
ed3527ab52
commit
90fa38495e
1 changed files with 1 additions and 1 deletions
|
@ -339,7 +339,7 @@ impl SqliteStorage {
|
|||
}
|
||||
|
||||
pub(crate) fn optimize(&self) -> Result<()> {
|
||||
self.db.execute_batch("vacuum; analyze")?;
|
||||
self.db.execute_batch("vacuum; reindex; analyze")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue