From 0fcf36c2a772e040041cee994963cf0808275c14 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 22 May 2012 20:22:33 +0900 Subject: [PATCH] fix upgrade of learning cards in 1.2 - interval must be 1+ days - type must be 2 --- anki/upgrade.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/anki/upgrade.py b/anki/upgrade.py index c86f5ea60..443fe23c7 100644 --- a/anki/upgrade.py +++ b/anki/upgrade.py @@ -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(