Unset the primary key if a model is deleted (see #6162)