-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[9.x] Optimize destroy method ππ»ββοΈ #45709
Conversation
93cfa19
to
27c1061
Compare
27c1061
to
21e985d
Compare
I don't know if this is intended or not, but now I can't destroy an array of models created with factory, here is an example:
Now we get the error: Idk if this is related to our environment or if it happens with everybody. But we only started to get this issue after the laravel update. |
@leonardocustodio |
This reverts commit 22443af.
Reverting. |
@leonardocustodio Thanks |
Since the
whereKey
is optimized to use thewhereIntegerRaw
whenever is possible, we can use it in the destroy method as well.The only little change in the underlying select query is that now it uses the fully qualified key.
(where "table"."key" in ... ) instead of key alone (where "key" in ... )
It also adds a few missing tests for edge cases.