vendredi 31 juillet 2015

MVC 5, want to add email address to userprofile, which table should I add to? userprofile or webpages_membership? (database design)

I have a new MVC5 web app, and currently, as of default, table: userprofile stores username and userId.

CREATE TABLE [dbo].[UserProfile] (
[UserId]            INT            IDENTITY (1, 1) NOT NULL,
[UserName]          NVARCHAR (MAX) NULL,
[FirstName]         VARCHAR (MAX)  NULL,
[LastName]          VARCHAR (MAX)  NULL,
PRIMARY KEY CLUSTERED ([UserId] ASC)
);

table: webpages_membership stores userpassword.

CREATE TABLE [dbo].[webpages_Membership] (
[UserId]                                  INT            NOT NULL,
[CreateDate]                              DATETIME       NULL,
[ConfirmationToken]                       NVARCHAR (128) NULL,
[IsConfirmed]                             BIT            DEFAULT ((0)) NULL,
[LastPasswordFailureDate]                 DATETIME       NULL,
[PasswordFailuresSinceLastSuccess]        INT            DEFAULT ((0)) NOT NULL,
[Password]                                NVARCHAR (128) NOT NULL,
[PasswordChangedDate]                     DATETIME       NULL,
[PasswordSalt]                            NVARCHAR (128) NOT NULL,
[PasswordVerificationToken]               NVARCHAR (128) NULL,
[PasswordVerificationTokenExpirationDate] DATETIME       NULL,
PRIMARY KEY CLUSTERED ([UserId] ASC)
);

I want to add emailaddress and emailaddressConfirmed to the table. which one should I add to? Or build one bit table that encompasses everything?

Also, I know nothing about membership and roles, should I invest sometime to learn about it? (Or is it only useful for esoteric things? )

Aucun commentaire:

Enregistrer un commentaire