[migration] `add_relation_type` warns and add missing definitions on already existing rtypes (closes #2121979) stable
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Thu, 09 Feb 2012 09:52:02 +0100
branchstable
changeset 8209 67660d5f1916
parent 8208 234096278b35
child 8212 a045d3821990
[migration] `add_relation_type` warns and add missing definitions on already existing rtypes (closes #2121979)
server/migractions.py
--- a/server/migractions.py	Fri Feb 10 10:36:40 2012 +0100
+++ b/server/migractions.py	Thu Feb 09 09:52:02 2012 +0100
@@ -1022,15 +1022,15 @@
 
         """
         reposchema = self.repo.schema
+        rschema = self.fs_schema.rschema(rtype)
+        execute = self._cw.execute
         if rtype in reposchema:
             print 'warning: relation type %s is already known, skip addition' % (
                 rtype)
-            return
-        rschema = self.fs_schema.rschema(rtype)
-        execute = self._cw.execute
-        # register the relation into CWRType and insert necessary relation
-        # definitions
-        ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False))
+        else:
+            # register the relation into CWRType and insert necessary relation
+            # definitions
+            ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False))
         if addrdef:
             self.commit()
             gmap = self.group_mapping()