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.
This commit is contained in:
Damien Elmes 2010-05-21 06:56:38 +09:00
parent edf121f8dc
commit 880219567e

View file

@ -1237,8 +1237,6 @@ where facts.id not in (select distinct factId from cards)""")
# delete unused # delete unused
self.s.statement("delete from tags where id in %s and priority = 2" % self.s.statement("delete from tags where id in %s and priority = 2" %
ids2str(unused)) ids2str(unused))
# remove any dangling facts
self.deleteDanglingFacts()
self.rebuildCounts() self.rebuildCounts()
self.refresh() self.refresh()
self.flushMod() self.flushMod()