mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
catch errors adding columns
This commit is contained in:
parent
cdce18f5c0
commit
6ec7fba13f
1 changed files with 18 additions and 15 deletions
|
@ -1578,6 +1578,7 @@ class DeckStorage(object):
|
|||
deck = DeckStorage._init(s)
|
||||
else:
|
||||
ver = s.scalar("select version from decks limit 1")
|
||||
try:
|
||||
if ver < 5:
|
||||
# add missing deck fields
|
||||
s.execute("""
|
||||
|
@ -1603,6 +1604,8 @@ alter table decks add column failedSoonCount integer not null default 0""")
|
|||
alter table decks add column revCount integer not null default 0""")
|
||||
s.execute("""
|
||||
alter table decks add column newCount integer not null default 0""")
|
||||
except:
|
||||
pass
|
||||
deck = s.query(Deck).get(1)
|
||||
# attach db vars
|
||||
deck.path = path
|
||||
|
|
Loading…
Reference in a new issue