server/migractions.py
changeset 9451 c83a8ecb9bf5
parent 9402 2c48c091b6a2
child 9456 a79e88aad555
equal deleted inserted replaced
9450:af4b93bc38a5 9451:c83a8ecb9bf5
   997                 # may think some required relation is missing... This also ensure
   997                 # may think some required relation is missing... This also ensure
   998                 # repository caches are properly cleanup
   998                 # repository caches are properly cleanup
   999                 hook.CleanupDeletedEidsCacheOp.get_instance(session).union(thispending)
   999                 hook.CleanupDeletedEidsCacheOp.get_instance(session).union(thispending)
  1000                 # and don't forget to remove record from system tables
  1000                 # and don't forget to remove record from system tables
  1001                 entities = [session.entity_from_eid(eid, rdeftype) for eid in thispending]
  1001                 entities = [session.entity_from_eid(eid, rdeftype) for eid in thispending]
  1002                 self.repo.system_source.delete_info_multi(session, entities, 'system')
  1002                 self.repo.system_source.delete_info_multi(session, entities)
  1003                 self.sqlexec('DELETE FROM cw_%s WHERE cw_from_entity=%%(eid)s OR '
  1003                 self.sqlexec('DELETE FROM cw_%s WHERE cw_from_entity=%%(eid)s OR '
  1004                              'cw_to_entity=%%(eid)s' % rdeftype,
  1004                              'cw_to_entity=%%(eid)s' % rdeftype,
  1005                              {'eid': oldeid}, ask_confirm=False)
  1005                              {'eid': oldeid}, ask_confirm=False)
  1006                 # now we have to manually cleanup relations pointing to deleted
  1006                 # now we have to manually cleanup relations pointing to deleted
  1007                 # entities
  1007                 # entities