From 880219567e72dbdcc5d319746af265e4d1b85277 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 21 May 2010 06:56:38 +0900 Subject: [PATCH] don't delete dangling facts when deleting cards If the user is not careful to only sync when one side has been modified, they can end up with cards on one side and not the other. If they then delete a card, deleting the dangling facts also deletes the fact associated with the not-yet-synced card. In order to avoid this, we avoid deleting dangling facts until a DB check. --- anki/deck.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 1d892fbcd..9b5ac249b 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -1237,8 +1237,6 @@ where facts.id not in (select distinct factId from cards)""") # delete unused self.s.statement("delete from tags where id in %s and priority = 2" % ids2str(unused)) - # remove any dangling facts - self.deleteDanglingFacts() self.rebuildCounts() self.refresh() self.flushMod()