mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
add hook into upgrade
This commit is contained in:
parent
e344e1a6a8
commit
96d3a25c9a
1 changed files with 2 additions and 0 deletions
|
@ -11,6 +11,7 @@ from anki.db import DB
|
||||||
from anki.deck import _Deck
|
from anki.deck import _Deck
|
||||||
from anki.stdmodels import BasicModel, ClozeModel
|
from anki.stdmodels import BasicModel, ClozeModel
|
||||||
from anki.errors import AnkiError
|
from anki.errors import AnkiError
|
||||||
|
from anki.hooks import runHook
|
||||||
|
|
||||||
def Deck(path, queue=True, lock=True):
|
def Deck(path, queue=True, lock=True):
|
||||||
"Open a new or existing deck. Path must be unicode."
|
"Open a new or existing deck. Path must be unicode."
|
||||||
|
@ -233,6 +234,7 @@ def _upgradeSchema(db):
|
||||||
raise AnkiError("oldDeckVersion")
|
raise AnkiError("oldDeckVersion")
|
||||||
if ver > 99:
|
if ver > 99:
|
||||||
return ver
|
return ver
|
||||||
|
runHook("1.x upgrade", db)
|
||||||
|
|
||||||
# cards
|
# cards
|
||||||
###########
|
###########
|
||||||
|
|
Loading…
Reference in a new issue