[migration] when adding a cube, skip infered relations (closes #3005576)
Skipped infered relations are recalculated later.
--- a/server/migractions.py Thu Jul 11 17:40:28 2013 +0200
+++ b/server/migractions.py Mon Jul 22 10:55:45 2013 +0200
@@ -688,7 +688,10 @@
for rschema in newcubes_schema.relations():
existingschema = self.repo.schema.rschema(rschema.type)
for (fromtype, totype) in rschema.rdefs:
- if (fromtype, totype) in existingschema.rdefs:
+ # if rdef already exists or is infered from inheritance,
+ # don't add it
+ if (fromtype, totype) in existingschema.rdefs \
+ or rschema.rdefs[(fromtype, totype)].infered:
continue
# check we should actually add the relation definition
if not (fromtype in new or totype in new or rschema in new):