server/migractions.py
branch3.5
changeset 3213 36a2357ccbc4
parent 3192 93c8fdcd943e
child 3230 1d25e928c299
child 3548 4cf5a360952e
equal deleted inserted replaced
3212:07d11bacfefe 3213:36a2357ccbc4
   413             return
   413             return
   414         repospschema = repoeschema.specializes()
   414         repospschema = repoeschema.specializes()
   415         espschema = eschema.specializes()
   415         espschema = eschema.specializes()
   416         if repospschema and not espschema:
   416         if repospschema and not espschema:
   417             self.rqlexec('DELETE X specializes Y WHERE X is CWEType, X name %(x)s',
   417             self.rqlexec('DELETE X specializes Y WHERE X is CWEType, X name %(x)s',
   418                          {'x': str(repoeschema)})
   418                          {'x': str(repoeschema)}, ask_confirm=False)
   419         elif not repospschema and espschema:
   419         elif not repospschema and espschema:
   420             self.rqlexec('SET X specializes Y WHERE X is CWEType, X name %(x)s, '
   420             self.rqlexec('SET X specializes Y WHERE X is CWEType, X name %(x)s, '
   421                          'Y is CWEType, Y name %(y)s',
   421                          'Y is CWEType, Y name %(y)s',
   422                          {'x': str(repoeschema), 'y': str(espschema)})
   422                          {'x': str(repoeschema), 'y': str(espschema)},
       
   423                          ask_confirm=False)
   423         self.rqlexecall(ss.updateeschema2rql(eschema),
   424         self.rqlexecall(ss.updateeschema2rql(eschema),
   424                         ask_confirm=self.verbosity >= 2)
   425                         ask_confirm=self.verbosity >= 2)
   425         for rschema, targettypes, role in eschema.relation_definitions(True):
   426         for rschema, targettypes, role in eschema.relation_definitions(True):
   426             if role == 'subject':
   427             if role == 'subject':
   427                 if not rschema in repoeschema.subject_relations():
   428                 if not rschema in repoeschema.subject_relations():