A user (Wille) deleted an admin account using the rails console but is unable to reuse the associated email address. They suspect this might be a bug.
IAmGav suggests using the data explorer plugin to find and delete the email record from the relevant table. However, Wille points out that this approach would require manual queries for multiple tables.
simon believes this might not be a bug and provides console commands to search for the email record and associated user. If the user is deleted, simon recommends destroying the email record, but only after creating a site backup.
So the old e-mail I had assigned to my admin account no longer existed after changing domains, so I wanted to change the e-mail address but couldn’t because it requires a verification to the old e-mail.
Long story short I did a bunch of things, changed some e-mails, created another admin account, and deleted the second admin account using the console, but now I can’t reuse the email I had assigned to the second admin account.
Not sure whether to put this under support or bugs.
To be honest I have a backup I could try to use, but before doing that, is this a bug? Any way to fix this without a full reset / restoring from a backup?
You’d still need to know which table(s) to look/delete from, unless you’re proposing that I should manually create 100+ uniquely crafted queries for 100+ different tables with different schemas.
Would appreciate if someone could recategorize this post under bugs.
If that gives you a result, try searching for the user with the user_id that was returned:
User.find_by(id: <email_record_id>)
My guess is that no user will be returned because the email belonged to the user you deleted. If that is the case, it should be safe to call destroy! on the email record. Before trying this, be sure that you have an up-to-date backup of your site.
If the email does belong to an existing user, do not delete the email record.