I am using an ASP.NET SQL membership provider. So, there is a table aspnet_Usersin which there is data about each of my users. (In fact, the table aspnet_Membershipappears to contain most of the evidence).
Now I want to save some information for each user in my database, so I thought that I was just creating a new table with a column UserId(GUID) and the ratio of FK to aspnet_Users. However, I found that I cannot easily access UserId, because it is not displayed through the membership API. (I know I can access it through ProviderUserKey, but it looks like the API is abstracting the internal UserIdin favor UserName, and I don't want to go too far against the grain).
So, I thought that instead I should put a column LoweredUserNamein my table and create an FK relation with it aspnet_Users. Bzzzt. Wrong, because although aspnet_Usersthere is a unique index in it LoweredUserName, it also includes ApplicationId- therefore, to create an FK relationship, I need to have a column ApplicationIdin my table too.
At first I thought: okay, I only deal with one application, so I just add such a column and give it a default value. Then I realized what ApplicationIda GUID is, so it would be painful to do this. It’s not difficult, but until I show my database, I can’t predict what the GUID will be.
It seems to me that I'm missing something, or something is wrong. What should I do?