new cards can't have due # > 32 bits

This commit is contained in:
Damien Elmes 2012-11-02 07:14:25 +09:00
parent 3ffe47f5d6
commit 9b3364c1bb

View file

@ -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