fix odue issue

This commit is contained in:
Damien Elmes 2012-05-08 02:11:40 +09:00
parent 50f1091e28
commit b2580a9a15
2 changed files with 7 additions and 1 deletions

View file

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

View file

@ -106,6 +106,12 @@ def _upgrade(col, ver):
del t['css']
col.models.save(m)
col.db.execute("update col set ver = 6")
if ver < 7:
col.modSchema()
col.db.execute(
"update cards set odue = 0 where (type = 1 or queue = 2) "
"and not odid")
col.db.execute("update col set ver = 7")
def _upgradeClozeModel(col, m):
m['type'] = MODEL_CLOZE