I've spent some time trying to reuse some migration scripts to get it fixed, but without luck so far 🙁
As far as I understand using
setLastPost method of the Discussion model can be used on all discussion which should fix the issue, but my codding skill is to weak to build this maintenance tool script from scratch.
I'm ready to pay some dev for help me get it sorted (with some cost estimation first of course... I would say €50 as starting price as it's just for small community forum available for free - nothing related to business. If you estimate higher price - please clarify why - maybe it's much more work than I think 😉 )
Also when this "tool" will be ready - it should be released to community for free use.
I think that this kind of "maintenance tool" can be useful in future when something being broken on DB...
As example - that's another person with similar issue:
In ideal world - it should be available on administration panel as a simple button to click for "Fix my database, recount discussion, tags and posts counts".
But simple php / CLI script is also fine for me 😉