mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
if there's an error upgrading, try fix integrity and try again
This commit is contained in:
parent
9b25fcc7a2
commit
d2ee2521bd
1 changed files with 5 additions and 1 deletions
|
@ -1619,6 +1619,10 @@ alter table decks add column newCount integer not null default 0""")
|
||||||
if backup:
|
if backup:
|
||||||
DeckStorage.backup(deck.modified, path)
|
DeckStorage.backup(deck.modified, path)
|
||||||
deck._initVars()
|
deck._initVars()
|
||||||
|
try:
|
||||||
|
deck = DeckStorage._upgradeDeck(deck, path)
|
||||||
|
except:
|
||||||
|
deck.fixIntegrity()
|
||||||
deck = DeckStorage._upgradeDeck(deck, path)
|
deck = DeckStorage._upgradeDeck(deck, path)
|
||||||
except OperationalError, e:
|
except OperationalError, e:
|
||||||
if (str(e.orig).startswith("database table is locked") or
|
if (str(e.orig).startswith("database table is locked") or
|
||||||
|
|
Loading…
Reference in a new issue