From feaedccc9ab8244fea31740c577e7b4a0164717c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 19 Nov 2009 13:07:43 +0900 Subject: [PATCH] fix field ordinals on db check --- anki/deck.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anki/deck.py b/anki/deck.py index 016d773d4..acaa54469 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -2306,7 +2306,7 @@ Return new path, relative to media dir.""" if quick: num = 4 else: - num = 9 + num = 10 self.startProgress(num) self.updateProgress(_("Checking integrity...")) 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 self.updateProgress(_("Updating priorities...")) 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 self.updateProgress(_("Rebuilding QA cache...")) fields = self.s.all("select id, value from fields")