backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 18 Feb 2011 08:04:10 +0100
changeset 7013 7e402e92caa6
parent 7009 123947d4a875 (current diff)
parent 7012 5ff6cb8bd2b3 (diff)
child 7015 e1605db1a933
backport stable
--- a/server/schemaserial.py	Thu Feb 17 16:46:38 2011 +0100
+++ b/server/schemaserial.py	Fri Feb 18 08:04:10 2011 +0100
@@ -235,7 +235,14 @@
             uniquecstreid, eeid, releid = values
             eschema = schema.schema_by_eid(eeid)
             relations = unique_togethers.setdefault(uniquecstreid, (eschema, []))
-            relations[1].append(ertidx[releid])
+            rel = ertidx[releid]
+            if isinstance(rel, schemamod.RelationDefinitionSchema):
+                # not yet migrated 3.9 database ('relations' target type changed
+                # to CWRType in 3.10)
+                rtype = rel.rtype.type
+            else:
+                rtype = str(rel)
+            relations[1].append(rtype)
         for eschema, unique_together in unique_togethers.itervalues():
             eschema._unique_together.append(tuple(sorted(unique_together)))
     schema.infer_specialization_rules()