Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fix $deleteWhenMissingModels on Jobs is ignored when Models use SoftDeletes trait #49807

Conversation

olml89
Copy link

@olml89 olml89 commented Jan 24, 2024

This is a PR to fix this issue: #49794

…into account the deletedAt column when retrieving Models from the database on SerializesAndRestoresModelIdentifiers::restoreModel
@olml89 olml89 force-pushed the fix/deletewhenmissingmodels-ignoring-softdeletes branch from 009ba74 to e8954b1 Compare January 24, 2024 12:39
@olml89 olml89 changed the title Fix $deleteWhenMissingModels on Jobs is ignored when Models use SoftDeletes trait [10.x] Fix $deleteWhenMissingModels on Jobs is ignored when Models use SoftDeletes trait Jan 24, 2024
return $this
->newQueryWithoutScopes()
->whereKey($ids)
->whereNull($this->getDeletedAtColumn());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this break any table without soft-deletes?

@taylorotwell
Copy link
Member

This would be a breaking change. You can delete the job manually if you want to delete on soft deleted models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants