Team-Tea-Time / laravel-forum

A slim, lean forum package designed for quick and easy integration in Laravel projects
https://laravel-forum.teamteatime.net/
MIT License
601 stars 165 forks source link

[5.x] Use index for sequence number on DeletePosts action #384

Closed jeffreyvr closed 1 month ago

jeffreyvr commented 1 month ago

Using the same method as done at #377 for updating sequence number, preventing timeouts on threads with a lot of posts.

Riari commented 1 month ago

Looks good. Thanks for dealing with that. With this, I'll probably remove the Post::getSequenceNumber method as there's no real need for it to exist as long as the sequence field is always correct.

The test workflow is slightly broken currently (will be fixed by #383) but I'm happy to merge this without it.

Riari commented 1 month ago

I've done new releases for both v5 and v6 with this fix. Thanks again!

Btw, I realised the sequence updates should probably be done with trashed posts included, so I pushed https://github.com/Team-Tea-Time/laravel-forum/commit/e09eaa1882a62cc8d9e1ebe04aba80cd1e5a4a64 to address that. I'm 99% sure this is fine, but please let me know if it causes problems for you.