if there's an error upgrading, try fix integrity and try again

This commit is contained in:
Damien Elmes 2008-11-15 20:12:14 +09:00
parent 9b25fcc7a2
commit d2ee2521bd

View file

@ -1619,6 +1619,10 @@ alter table decks add column newCount integer not null default 0""")
if backup:
DeckStorage.backup(deck.modified, path)
deck._initVars()
try:
deck = DeckStorage._upgradeDeck(deck, path)
except:
deck.fixIntegrity()
deck = DeckStorage._upgradeDeck(deck, path)
except OperationalError, e:
if (str(e.orig).startswith("database table is locked") or