code: def __remove_category(self, id):
          affected_query =
          affected_ids = [res[0] for res in self.fetchall(affected_query, (id,))]
          update = "update activities set category_id = -1 where category_id = ?"
          self.execute(update, (id, ))
          self.execute("delete from categories where id = ?", (id, ))
          self.__remove_index(affected_ids)