server/migractions.py
branchstable
changeset 8209 67660d5f1916
parent 8049 a48301a44b50
child 8216 99ff746e8de8
child 8232 8c29253105ba
equal deleted inserted replaced
8208:234096278b35 8209:67660d5f1916
  1020         creation (but not the relation definitions themselves, for which
  1020         creation (but not the relation definitions themselves, for which
  1021         committing depends on the `commit` argument value).
  1021         committing depends on the `commit` argument value).
  1022 
  1022 
  1023         """
  1023         """
  1024         reposchema = self.repo.schema
  1024         reposchema = self.repo.schema
       
  1025         rschema = self.fs_schema.rschema(rtype)
       
  1026         execute = self._cw.execute
  1025         if rtype in reposchema:
  1027         if rtype in reposchema:
  1026             print 'warning: relation type %s is already known, skip addition' % (
  1028             print 'warning: relation type %s is already known, skip addition' % (
  1027                 rtype)
  1029                 rtype)
  1028             return
  1030         else:
  1029         rschema = self.fs_schema.rschema(rtype)
  1031             # register the relation into CWRType and insert necessary relation
  1030         execute = self._cw.execute
  1032             # definitions
  1031         # register the relation into CWRType and insert necessary relation
  1033             ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False))
  1032         # definitions
       
  1033         ss.execschemarql(execute, rschema, ss.rschema2rql(rschema, addrdef=False))
       
  1034         if addrdef:
  1034         if addrdef:
  1035             self.commit()
  1035             self.commit()
  1036             gmap = self.group_mapping()
  1036             gmap = self.group_mapping()
  1037             cmap = self.cstrtype_mapping()
  1037             cmap = self.cstrtype_mapping()
  1038             done = set()
  1038             done = set()