tog22 / eahub

EA Hub
7 stars 1 forks source link

Merge users with identical emails & then require emails to be unique #28

Closed tog22 closed 9 years ago

tog22 commented 9 years ago

Get duplicates using SELECT mail, count(*) FROM users GROUP BY mail HAVING count(*) > 1;

Take best guess at account they use. Merge in fields you can add from the other account (if there's a clash and it's ambiguous which version to use, leave the field as is). Delete the other account. Then when done this for them all, do:

ALTER TABLE users
DROP INDEX email;

ALTER TABLE users
ADD UNIQUE INDEX email;
tog22 commented 9 years ago

Done.