# HG changeset patch # User Katia Saurfelt # Date 1328777522 -3600 # Node ID 67660d5f1916b0db3a8b6c16b82bd31bb3d1d438 # Parent 234096278b35076af2926f867a334431309e36a9 [migration] `add_relation_type` warns and add missing definitions on already existing rtypes (closes #2121979) diff -r 234096278b35 -r 67660d5f1916 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()