check prefs21.db integrity

otherwise some corruption errors only become apparent when trying to
load an individual profile
This commit is contained in:
Damien Elmes 2018-01-14 17:47:21 +10:00
parent 7915dcd1d9
commit 3a059d15b5

View file

@ -307,6 +307,7 @@ Anki's prefs21.db file was corrupt and has been recreated. If you were using mul
profiles, please add them back using the same names to recover your cards.""") profiles, please add them back using the same names to recover your cards.""")
try: try:
self.db = DB(path) self.db = DB(path)
assert self.db.scalar("pragma integrity_check") == "ok"
self.db.execute(""" self.db.execute("""
create table if not exists profiles create table if not exists profiles
(name text primary key, data text not null);""") (name text primary key, data text not null);""")