make sure we don't delete cloze notes in db check

This commit is contained in:
Damien Elmes 2012-10-26 19:43:34 +09:00
parent 8a06ab7bfe
commit 76926c953a

View file

@ -642,6 +642,9 @@ select id from notes where mid not in """ + ids2str(self.models.ids()))
self.remNotes(ids)
# cards with invalid ordinal
for m in self.models.all():
# ignore clozes
if m['type'] != MODEL_STD:
continue
ids = self.db.list("""
select id from cards where ord not in %s and nid in (
select id from notes where mid = ?)""" %