mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 15:17:12 -05:00
forget old gravestones on schema change
This commit is contained in:
parent
467eb87a48
commit
80153c63cb
1 changed files with 4 additions and 4 deletions
|
|
@ -3004,6 +3004,10 @@ Return new path, relative to media dir."""
|
|||
def setSchemaModified(self):
|
||||
# we might be called during an upgrade, so avoid bumping modtime
|
||||
self.setVar("schemaMod", time.time(), mod=False)
|
||||
# since we guarantee a full sync to all clients, this is a good time
|
||||
# to forget old gravestones
|
||||
for k in ("cards", "facts", "models", "media"):
|
||||
self.db.statement("delete from %sDeleted" % k)
|
||||
|
||||
def flushMod(self):
|
||||
"Mark modified and flush to DB."
|
||||
|
|
@ -3251,10 +3255,6 @@ where cards.cardModelId = cardModels.id)""")
|
|||
# rebuild
|
||||
self.updateProgress()
|
||||
self.rebuildTypes()
|
||||
# since we can ensure the updated version will be propagated to
|
||||
# all locations, we can forget old tombstones
|
||||
for k in ("cards", "facts", "models", "media"):
|
||||
self.db.statement("delete from %sDeleted" % k)
|
||||
# force a full sync
|
||||
self.setSchemaModified()
|
||||
# and finally, optimize
|
||||
|
|
|
|||
Loading…
Reference in a new issue