The wizard that adds criteria to a filter maintains a reference to that filter. That makes it impossible to delete the filter pointed to. By changing the filter_id field to delete cascade, this problem is solved.