From fae153c2afdd6e66fcfb293fd4489d7e7053e8bc Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 24 Nov 2011 16:33:40 +0900 Subject: [PATCH] don't mod schema when adding new models --- anki/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/anki/models.py b/anki/models.py index c977ca842..3fd1b7691 100644 --- a/anki/models.py +++ b/anki/models.py @@ -273,6 +273,10 @@ select id from cards where nid in (select id from notes where mid = ?)""", f['ord'] = c def _transformFields(self, m, fn): + if not self.col.db.scalar( + "select 1 from notes where mid = ? limit 1", m['id']): + # don't bump schema for a new model + return self.col.modSchema() r = [] for (id, flds) in self.col.db.execute(