When posts are moved from one topic to another, the topic_user.bookmarked column for all users in the new and the old topic needs to be resynced, for example because a user bookmarks post 12 in topic 1, then it is moved to topic 2, the topic_user record for topic 1 should no longer be bookmarked.
This has been addressed in other places in the past:
Overall the PR looks good, but I’m always unsure of performance implications of queries like this.
It will run a count(*) subquery for each topic_users record that has bookmarked set to true? Will the database optimize it, and even if it will – are you sure it won’t cause problems on massive forums?
The same question applies to SyncTopicUserBookmarked.
Well, I assume it will work fine because a similar migration has been run twice before without any issues See the other 2 PRs linked in the OP. I will do a quick test against meta and see (using BEGIN…ROLLBACK)