I 've been searching the forum for info on updating external_id on discourse db.
found this topic interesting:
Still I was interested in some insights regarding the implications of updating the external_id on the database.
could I just issue an sql update and set the new correct external_id? can that bring any hidden problems? like if the user has a current open session or something else?
I got the users created through sso using an external_id that’s the user’s account id on the external system. (I may need to model something else but it would be cool to be able to avoid changing the external system model at least for now)
the problem for me is that the person may have more than one account on the external system and can merge those accounts into one so sometimes depending on how he merges a new external_id can come for the same user/email.
I am using the require_activation option so as I 've read on the mentioned topic I can’t delete the record and wait for it to be recreated.
a) synchronize all accounts to discourse using the SSO sync mechanism
b) keep track of which accounts have been used to log in to Discourse
c) when you merge, do an external ID lookup to determine which account(s) have been used with Discourse