diff --git a/anki/collection.py b/anki/collection.py index 61710b6a8..79e56c22a 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -670,6 +670,10 @@ select id from notes where id not in (select distinct nid from cards)""") # field cache for m in self.models.all(): self.updateFieldCache(self.models.nids(m)) + # new cards can't have a due position > 32 bits + self.db.execute(""" +update cards set due = 1000000, mod = ?, usn = ? where due > 1000000 +and queue = 0""", intTime(), self.usn()) # new card position self.conf['nextPos'] = self.db.scalar( "select max(due)+1 from cards where type = 0") or 0