868 self.sqlexec('INSERT INTO %s%s(%s) SELECT %s FROM %s%s' % ( |
868 self.sqlexec('INSERT INTO %s%s(%s) SELECT %s FROM %s%s' % ( |
869 SQL_PREFIX, newname, attrs, attrs, SQL_PREFIX, oldname), |
869 SQL_PREFIX, newname, attrs, attrs, SQL_PREFIX, oldname), |
870 ask_confirm=False) |
870 ask_confirm=False) |
871 # old entity type has not been added to the schema, can't gather it |
871 # old entity type has not been added to the schema, can't gather it |
872 new = schema.eschema(newname) |
872 new = schema.eschema(newname) |
873 oldeid = self.rqlexec('CWEType ET WHERE ET name %(on)s', {'on': oldname}, |
873 oldeid = self.rqlexec('CWEType ET WHERE ET name %(on)s', |
874 ask_confirm=False)[0][0] |
874 {'on': oldname}, ask_confirm=False)[0][0] |
875 # backport old type relations to new type |
875 # backport old type relations to new type |
876 # XXX workflows, other relations? |
876 # XXX workflows, other relations? |
877 for r1, rr1 in [('from_entity', 'to_entity'), |
877 for r1, rr1 in [('from_entity', 'to_entity'), |
878 ('to_entity', 'from_entity')]: |
878 ('to_entity', 'from_entity')]: |
879 self.rqlexec('SET X %(r1)s NET WHERE X %(r1)s OET, ' |
879 self.rqlexec('SET X %(r1)s NET WHERE X %(r1)s OET, ' |