mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
fix field ordinals on db check
This commit is contained in:
parent
c3833a6a10
commit
feaedccc9a
1 changed files with 6 additions and 1 deletions
|
@ -2306,7 +2306,7 @@ Return new path, relative to media dir."""
|
||||||
if quick:
|
if quick:
|
||||||
num = 4
|
num = 4
|
||||||
else:
|
else:
|
||||||
num = 9
|
num = 10
|
||||||
self.startProgress(num)
|
self.startProgress(num)
|
||||||
self.updateProgress(_("Checking integrity..."))
|
self.updateProgress(_("Checking integrity..."))
|
||||||
if self.s.scalar("pragma integrity_check") != "ok":
|
if self.s.scalar("pragma integrity_check") != "ok":
|
||||||
|
@ -2404,6 +2404,11 @@ select id from fields where factId not in (select id from facts)""")
|
||||||
# fix any priorities
|
# fix any priorities
|
||||||
self.updateProgress(_("Updating priorities..."))
|
self.updateProgress(_("Updating priorities..."))
|
||||||
self.updateAllPriorities(dirty=False)
|
self.updateAllPriorities(dirty=False)
|
||||||
|
# make sure
|
||||||
|
self.updateProgress(_("Updating ordinals..."))
|
||||||
|
self.s.statement("""
|
||||||
|
update fields set ordinal = (select ordinal from fieldModels
|
||||||
|
where id = fieldModelId)""")
|
||||||
# fix problems with stripping html
|
# fix problems with stripping html
|
||||||
self.updateProgress(_("Rebuilding QA cache..."))
|
self.updateProgress(_("Rebuilding QA cache..."))
|
||||||
fields = self.s.all("select id, value from fields")
|
fields = self.s.all("select id, value from fields")
|
||||||
|
|
Loading…
Reference in a new issue