Fix foreign constraint when deleting a prediction