server/migractions.py
branchstable
changeset 9164 4415209bea0a
parent 9162 bf0a575d8da8
child 9175 a7412e884d7b
equal deleted inserted replaced
9163:fe4c1c1982e7 9164:4415209bea0a
   686             new.add(eschema.type)
   686             new.add(eschema.type)
   687         # check if attributes has been added to existing entities
   687         # check if attributes has been added to existing entities
   688         for rschema in newcubes_schema.relations():
   688         for rschema in newcubes_schema.relations():
   689             existingschema = self.repo.schema.rschema(rschema.type)
   689             existingschema = self.repo.schema.rschema(rschema.type)
   690             for (fromtype, totype) in rschema.rdefs:
   690             for (fromtype, totype) in rschema.rdefs:
   691                 if (fromtype, totype) in existingschema.rdefs:
   691                 # if rdef already exists or is infered from inheritance,
       
   692                 # don't add it
       
   693                 if (fromtype, totype) in existingschema.rdefs \
       
   694                         or rschema.rdefs[(fromtype, totype)].infered:
   692                     continue
   695                     continue
   693                 # check we should actually add the relation definition
   696                 # check we should actually add the relation definition
   694                 if not (fromtype in new or totype in new or rschema in new):
   697                 if not (fromtype in new or totype in new or rschema in new):
   695                     continue
   698                     continue
   696                 self.cmd_add_relation_definition(str(fromtype), rschema.type,
   699                 self.cmd_add_relation_definition(str(fromtype), rschema.type,