LinkStackOrg / LinkStack

LinkStack - the ultimate solution for creating a personalized & professional profile page. Showcase all your important links in one place, forget the limitation of one link on social media. Set up your personal site on your own server with just a few clicks.
https://linkstack.org
GNU Affero General Public License v3.0
2.3k stars 235 forks source link

Unique index users_name_unique #288

Closed valimero closed 1 year ago

valimero commented 1 year ago

Hello !

Is there a reason to have the unique index "users_name_unique" ?

2 users cannot have the same name..

JulianPrieber commented 1 year ago

I'm not sure if I understand your question.

You cannot have two users with the same name. And we have to prevent this from happening.

valimero commented 1 year ago

I need to create two users with the same name.

Today, if I try to do it, I have this error:

Illuminate\Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'John Doe' for key 'users_name_unique' (SQL: update `users` set `name` = John Doe, `email` = w4aCkTwB@example.com, `littlelink_name` = ?, `littlelink_description` = ?, `role` = user, `users`.`updated_at` = 2022-12-29 18:34:24 where `id` = 33)

So I'm asking if there is a specific reason to forbid same names in mysql..

JulianPrieber commented 1 year ago

This would definitely break stuff if this would be possible.

valimero commented 1 year ago

@JulianPrieber Do you have an example ?

JulianPrieber commented 1 year ago

I haven't fully looked into this. You can remove the unique requirement and use your instance as normal for the most part. For future updates, I'd like to keep the unique requirement.

I'm not entirely sure if our social login solution works properly and security without it. Again, Í never really had an intensive to test this out, as I'd rather not change anything that is working fine.

I might actually consider looking into this to see if this is viable to have as a full feature.

JulianPrieber commented 1 year ago

We are now testing this in the latest beta.