[migration] take care to entity being added stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 30 Sep 2009 16:34:43 +0200
branchstable
changeset 3531 c095f5f54873
parent 3530 7dfe9d2c0fe7
child 3532 df045bc51d00
[migration] take care to entity being added
server/schemahooks.py
--- a/server/schemahooks.py	Wed Sep 30 16:23:12 2009 +0200
+++ b/server/schemahooks.py	Wed Sep 30 16:34:43 2009 +0200
@@ -345,8 +345,11 @@
                 self.error('error while creating index for %s.%s: %s',
                            table, column, ex)
         # final relations are not infered, propagate
+        try:
+            eschema = self.schema.eschema(rdef.subject)
+        except KeyError:
+            return # entity type currently being added
         rschema = self.schema.rschema(rdef.name)
-        eschema = self.schema.eschema(rdef.subject)
         props.update({'constraints': rdef.constraints,
                       'description': rdef.description,
                       'cardinality': rdef.cardinality,