[migration] fix bug when propagating newly inserted relation type to children classes stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 02 Oct 2009 10:14:29 +0200
branchstable
changeset 3550 f9bdcfeb12ee
parent 3549 63718638352e
child 3551 5a73db781dac
[migration] fix bug when propagating newly inserted relation type to children classes
server/schemahooks.py
--- a/server/schemahooks.py	Fri Oct 02 08:57:55 2009 +0200
+++ b/server/schemahooks.py	Fri Oct 02 10:14:29 2009 +0200
@@ -351,6 +351,10 @@
             return # entity type currently being added
         # propagate attribute to children classes
         rschema = self.schema.rschema(rdef.name)
+        # if relation type has been inserted in the same transaction, its final
+        # attribute is still set to False, so we've to ensure it's False
+        rschema.final = True
+        # XXX 'infered': True/False, not clear actually
         props.update({'constraints': rdef.constraints,
                       'description': rdef.description,
                       'cardinality': rdef.cardinality,