[migration] `add_relation_type` warns and add missing definitions on already existing rtypes (closes #2121979)
--- 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()