[9.x] Optimize destroy method ππ»ββοΈ#45709
[9.x] Optimize destroy method ππ»ββοΈ#45709taylorotwell merged 1 commit intolaravel:9.xfrom
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
whereKeyis optimized to use thewhereIntegerRawwhenever 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.