• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Make username not unique?

Chris D

XenForo developer
Staff member
#2
Yikes...

I would have thought that's a pretty extensive change...

But one thing you could try in a completely isolated test board is removing the unique index on the username field with this query:

Code:
ALTER TABLE `xf_user` 
DROP INDEX `username`
I haven't even begun to think about the problems this could cause, though, so please do proceed with caution.

There's quite a few cases, I think, where XenForo assumes the username is unique so I think this could require some pretty extensive development. I know why you want to do it though... Just a big task, I think.
 

Mike

XenForo developer
Staff member
#4
Yeah, bad idea. Think about conversations, user searches, tagging, find by user, etc. Everything user facing in XF is geared around usernames.
 

Mike

XenForo developer
Staff member
#6
You just tagged "Mike" -- the system found the ID from the name. What if there are 2 Mikes?
 

Mike Edge

Well-known member
#7
Yikes...

I would have thought that's a pretty extensive change...

But one thing you could try in a completely isolated test board is removing the unique index on the username field with this query:

Code:
ALTER TABLE `xf_user`
DROP INDEX `username`
I haven't even begun to think about the problems this could cause, though, so please do proceed with caution.

There's quite a few cases, I think, where XenForo assumes the username is unique so I think this could require some pretty extensive development. I know why you want to do it though... Just a big task, I think.

Revisiting this as I finally got around to this project idea again.. Trying to create a second user with same username it says User names must be unique. The specified user name is already in use. I did the alter you gave me to drop the index.
 

Mike Edge

Well-known member
#9
Any sggestions on if I was to tag Test1 how to make both registered appear in the popup to select, not just the lowest user_id one
 

Chris D

XenForo developer
Staff member
#10
Frankly, no.

We're still of the opinion that this is a pretty bad idea from a technical point of view. And this issue you're experiencing now is just one of the problems you will face.

The system is designed to expect that usernames are unique. If you remove that constraint then you're going to find numerous things that stop working as expected.