Created
August 21, 2012 21:08
-
-
Save kenstone/3419405 to your computer and use it in GitHub Desktop.
SQL Table definitions for ASP.NET 4.5 Simple Membership Authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[UserProfile] ( | |
[UserId] INT IDENTITY (1, 1) NOT NULL, | |
[UserName] NVARCHAR (MAX) NULL, | |
PRIMARY KEY CLUSTERED ([UserId] ASC) | |
); | |
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) | |
); | |
CREATE TABLE [dbo].[webpages_OAuthMembership] ( | |
[Provider] NVARCHAR (30) NOT NULL, | |
[ProviderUserId] NVARCHAR (100) NOT NULL, | |
[UserId] INT NOT NULL, | |
PRIMARY KEY CLUSTERED ([Provider] ASC, [ProviderUserId] ASC) | |
); | |
CREATE TABLE [dbo].[webpages_Roles] ( | |
[RoleId] INT IDENTITY (1, 1) NOT NULL, | |
[RoleName] NVARCHAR (256) NOT NULL, | |
PRIMARY KEY CLUSTERED ([RoleId] ASC), | |
UNIQUE NONCLUSTERED ([RoleName] ASC) | |
); | |
CREATE TABLE [dbo].[webpages_UsersInRoles] ( | |
[UserId] INT NOT NULL, | |
[RoleId] INT NOT NULL, | |
PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC), | |
CONSTRAINT [fk_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[UserProfile] ([UserId]), | |
CONSTRAINT [fk_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[webpages_Roles] ([RoleId]) | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome, thx