My Discourse instance is authenticating against my organisation’s membership system via the discourse-oauth2-basic plugin.
It uses the membership number from the membership system as the Discourse user_id.
Now some bright person has swapped two users’ ids in the membership system, so they are now logging in to each other’s accounts. Grrrr.
Is it possible to change the user_id of an account on Discourse? I’m guessing that I’ll have to go through every table updating user_ids on both user’s posts. My approach is to do the following:
User A (user_id=1)
User B (user_id=2)
- Find all rows in all tables with user_id=1 and update to user_id=99999
- Find all rows in all tables with user_id=2 and update to user_id=1
- Find all rows in all tables with user_id=99999 and update to user_id=2
- Find the person that thinks that sharing membership ids is a good thing and educate them.
Does anyone see a problem with the above?