mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
ensure duplicate model creation times are accounted for
This commit is contained in:
parent
5868ff52b9
commit
ebac628187
2 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue