diff --git a/anki/storage.py b/anki/storage.py index 59f5ac130..92d470842 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -511,12 +511,16 @@ def _fixupModels(deck): # rewrite model/template/field ids models = deck.models() deck.db.execute("delete from models") + times = {} for c, m in enumerate(models.values()): # update ordinals m._updateFieldOrds() m._updateTemplOrds() # we've temporarily stored the model creation time in the mod time old = m.id + while m.mod in times: + m.mod += 1 + times[m.mod] = True m.id = m.mod m.mod = intTime() m.flush() diff --git a/tests/support/anki12.anki b/tests/support/anki12.anki index 3ee5fe744..042ecf4f4 100644 Binary files a/tests/support/anki12.anki and b/tests/support/anki12.anki differ