diff --git a/anki/consts.py b/anki/consts.py index e28266246..094b444e5 100644 --- a/anki/consts.py +++ b/anki/consts.py @@ -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 diff --git a/anki/storage.py b/anki/storage.py index 880bd1fac..c7d13da0a 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -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