[migration] Skip virtual rtypes when adding relation definition through add_cube 3.24
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 19 Jan 2017 11:12:07 +0100
branch3.24
changeset 11906 51057823b528
parent 11905 2f36115d38b1
child 11907 3be141d6c82c
[migration] Skip virtual rtypes when adding relation definition through add_cube Virtual rtypes should be skipped as they are added dynamically on loading schema. Those are skipped by e.g. schema serialisation or add_entity_type, do the same thing here.
cubicweb/server/migractions.py
--- a/cubicweb/server/migractions.py	Thu Jan 19 11:10:47 2017 +0100
+++ b/cubicweb/server/migractions.py	Thu Jan 19 11:12:07 2017 +0100
@@ -675,6 +675,8 @@
             new.add(eschema.type)
         # check if attributes has been added to existing entities
         for rschema in newcubes_schema.relations():
+            if rschema.type in VIRTUAL_RTYPES:
+                continue
             existingschema = self.repo.schema.rschema(rschema.type)
             for (fromtype, totype) in rschema.rdefs:
                 # if rdef already exists or is infered from inheritance,