From c371d318a22ed6b444b370eac7ebd841139058c1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 19 Jul 2012 23:57:51 +0900 Subject: [PATCH] fix ordinals instead of aborting upgrade --- anki/upgrade.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/anki/upgrade.py b/anki/upgrade.py index 0c5a7617d..f9ec7e74f 100644 --- a/anki/upgrade.py +++ b/anki/upgrade.py @@ -90,11 +90,9 @@ f.id = cards.factId)"""): if db.list(""" select id from fields where factId not in (select id from facts)"""): return - # fields without matching interval - if db.list(""" - select id from fields where ordinal != (select ordinal from fieldModels - where id = fieldModelId)"""): - return + # fix ordinal numbers + db.execute("""update fields set ordinal = (select ordinal from +fieldModels where id = fieldModelId)""") # incorrect types if db.list(""" select id from cards where relativeDelay != (case