make sure we don't reduce mid down to 0 on very old anki decks

This commit is contained in:
Damien Elmes 2012-10-30 06:27:55 +09:00
parent d3f0c84517
commit 6ff5c3b2c2

View file

@ -341,8 +341,10 @@ insert or replace into col select id, cast(created as int), :t,
mods = {}
for row in db.all(
"select id, name from models"):
# use only first 31 bits
t = abs(row[0]) >> 32
# use only first 31 bits if not old anki id
t = abs(row[0])
if t > 4294967296:
t >>= 32
m = anki.models.defaultModel.copy()
m['id'] = t
m['name'] = row[1]