fix upgrade of learning cards in 1.2

- interval must be 1+ days
- type must be 2
This commit is contained in:
Damien Elmes 2012-05-22 20:22:33 +09:00
parent 233bf555b4
commit 0fcf36c2a7

View file

@ -682,9 +682,10 @@ and ord = ? limit 1""", m['id'], t['ord']):
for t in ("cards", "notes", "models", "media"):
col.db.execute("drop table if exists %sDeleted" % t)
# and failed cards
left = len(col.decks.confForDid(1)['new']['delays'])*1001
col.db.execute("update cards set odue = ?, left=? where type = 1",
col.sched.today+1, left)
left = len(col.decks.confForDid(1)['lapse']['delays'])*1001
col.db.execute("""
update cards set odue = ?, left=?, type=2, ivl=max(ivl, 1) where type=1""",
col.sched.today+1, left)
# and due cards
col.db.execute("""
update cards set due = cast(