upgrade decks to fix odue bug

This commit is contained in:
Damien Elmes 2012-04-22 07:16:10 +09:00
parent fd30167c49
commit ae3e775fdd
2 changed files with 4 additions and 1 deletions

View file

@ -42,7 +42,7 @@ MODEL_STD = 0
MODEL_CLOZE = 1
# deck schema & syncing vars
SCHEMA_VERSION = 4
SCHEMA_VERSION = 5
SYNC_ZIP_SIZE = int(2.5*1024*1024)
SYNC_URL = os.environ.get("SYNC_URL") or "https://beta.ankiweb.net/sync/"
SYNC_VER = 2

View file

@ -92,6 +92,9 @@ def _upgrade(col, ver):
for m in clozes:
_upgradeClozeModel(col, m)
col.db.execute("update col set ver = 4")
if ver < 5:
col.db.execute("update cards set odue = 0 where queue = 2")
col.db.execute("update col set ver = 5")
def _upgradeClozeModel(col, m):
m['type'] = MODEL_CLOZE