Fix foreign key errors related to deleted products.