views:

148

answers:

2

Hi folks

i'm trying to create a Users table that only has OpenId registrations, exactly like StackOverflow.

I'm storing in the table

  • OpenId Identifier (their login name)
  • Alias (which is the display name to show to the public)
  • Some other openId stuff

So .. I want make sure that there is only ONE user in the system that has the open id idenfitier and only one alias.

Of course, i can change my alias at any time. I could also change my openId identifier at any time.

I need to make sure that these are unique / only exist once.

SO .. do i create TWO unique key index's for the table, or one unique key index with both fields in it?

cheers :)

+1  A: 

Make two unique keys. Otherwise, the same openid can have more than one user associated.

friol
+1  A: 

One for each of them.

If you'd create just one that contains both you could have - for examlpe - two users with the same alias, as long as they have two different OpenIDs.

However:

  • I'd suggest, that you create one User Table and another OpenID Table that allows users to link more than one OpenID with their account. Let's say, they have an OpenID at Yahoo and another at MyOpenID. If - due to whatever reason - Yahoo decides to shut down it's OpenID service the person would still be able to log in with his MyOpenID Login. Well, as long as he has registered that ID with his account earlier.
BlaM
I've read a lot about having multi openId's per user, but i'm not going to do that cause i don't want to offer the ability. It's adding complexity i don't want. If u need to merge, they can email support :P
Pure.Krome