I have figured it myself!
@developer:
Why do you advise to UPDATE the userid column with the new ID even though the complete corresponding entryid rows get REMOVED when a user has been deleted????
You could have saved me a lot of time posting that the thanks given are lost at the moment when the user has been deleted!
The thanks received (receiveduserid column) persist (the entryid rows), though and can be recovered by updating with the new ID!
Can you change that at a further update of your mod, please?
I mean the userprofile is gone anyway, the thanks received are still left and the thanks given could be still left over at your table for recovery...a little improvement.
Thanks again.