mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
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:
parent
edf121f8dc
commit
880219567e
1 changed files with 0 additions and 2 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue