Foren

non unique index on User_ (companyId, emailAddress)

Hubert Felber, geändert vor 14 Jahren.

non unique index on User_ (companyId, emailAddress)

Regular Member Beiträge: 157 Beitrittsdatum: 23.11.09 Neueste Beiträge
Hi,
create unique index IX_615E9F7A on User_ (companyId, emailAddress);

Since 5.2.3 this index is unique. This prevents us from having multiple users with same email address (info@company.com).
I think it is a common requirement, to have this. We use screenname for authentication, not the email-address.
My suggestion is to drop the "unique" from the index.

Hubert
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: non unique index on User_ (companyId, emailAddress)

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste Beiträge
I don't know why these guys don't use primary keys like the rest of the plant. It's the R in the RDBMS... Stuff like this is reason why. When you use primary keys, the primary key can be unique but none of the rest of the stuff in that row *has* to be unique and it can all be changed.

Frankly, if you have a large org, email addresses can be recycled. Jane Doe leaves the company and John Doe gets hired.

Since you can authenticate via screen name or email addy, I understand why it has to be unique - that is your user name.
thumbnail
Imtiaz Ahmed, geändert vor 14 Jahren.

RE: non unique index on User_ (companyId, emailAddress)

Junior Member Beiträge: 57 Beitrittsdatum: 02.01.08 Neueste Beiträge
I had the same problem and I dropped the index to make it work. So far, it hasn't given me any problems so I can say it's pretty safe to do that.
thumbnail
Shagul Khaja, geändert vor 14 Jahren.

RE: non unique index on User_ (companyId, emailAddress)

Liferay Master Beiträge: 758 Beitrittsdatum: 27.09.07 Neueste Beiträge
Imtiaz Ahmed:
I had the same problem and I dropped the index to make it work. So far, it hasn't given me any problems so I can say it's pretty safe to do that.


Hi Imtiaz,

Dropping the index is a quick fix. This may work as long as the authentication mechanism is not email address. Also where ever the system tries to get the user by email address, this will return the first user and the permissions/roles of that user.
thumbnail
Jorge Ferrer, geändert vor 14 Jahren.

Moving thread

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
Moving thread to the appropriate category