Created
October 15, 2018 17:01
-
-
Save hieuhani/1039de6b9681714782a38c5a30fe4c35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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].[AspNetRoleClaims] ( | |
[Id] INT IDENTITY (1, 1) NOT NULL, | |
[RoleId] NVARCHAR (450) NOT NULL, | |
[ClaimType] NVARCHAR (MAX) NULL, | |
[ClaimValue] NVARCHAR (MAX) NULL, | |
CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY CLUSTERED ([Id] ASC), | |
CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE | |
); | |
GO | |
CREATE NONCLUSTERED INDEX [IX_AspNetRoleClaims_RoleId] | |
ON [dbo].[AspNetRoleClaims]([RoleId] ASC); | |
This file contains hidden or 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].[AspNetRoles] ( | |
[Id] NVARCHAR (450) NOT NULL, | |
[Name] NVARCHAR (256) NULL, | |
[NormalizedName] NVARCHAR (256) NULL, | |
[ConcurrencyStamp] NVARCHAR (MAX) NULL, | |
CONSTRAINT [PK_AspNetRoles] PRIMARY KEY CLUSTERED ([Id] ASC) | |
); | |
GO | |
CREATE UNIQUE NONCLUSTERED INDEX [RoleNameIndex] | |
ON [dbo].[AspNetRoles]([NormalizedName] ASC) WHERE ([NormalizedName] IS NOT NULL); | |
This file contains hidden or 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].[AspNetUserClaims] ( | |
[Id] INT IDENTITY (1, 1) NOT NULL, | |
[UserId] NVARCHAR (450) NOT NULL, | |
[ClaimType] NVARCHAR (MAX) NULL, | |
[ClaimValue] NVARCHAR (MAX) NULL, | |
CONSTRAINT [PK_AspNetUserClaims] PRIMARY KEY CLUSTERED ([Id] ASC), | |
CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE | |
); | |
GO | |
CREATE NONCLUSTERED INDEX [IX_AspNetUserClaims_UserId] | |
ON [dbo].[AspNetUserClaims]([UserId] ASC); | |
This file contains hidden or 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].[AspNetUserLogins] ( | |
[LoginProvider] NVARCHAR (450) NOT NULL, | |
[ProviderKey] NVARCHAR (450) NOT NULL, | |
[ProviderDisplayName] NVARCHAR (MAX) NULL, | |
[UserId] NVARCHAR (450) NOT NULL, | |
CONSTRAINT [PK_AspNetUserLogins] PRIMARY KEY CLUSTERED ([LoginProvider] ASC, [ProviderKey] ASC), | |
CONSTRAINT [FK_AspNetUserLogins_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE | |
); | |
GO | |
CREATE NONCLUSTERED INDEX [IX_AspNetUserLogins_UserId] | |
ON [dbo].[AspNetUserLogins]([UserId] ASC); | |
This file contains hidden or 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].[AspNetUserRoles] ( | |
[UserId] NVARCHAR (450) NOT NULL, | |
[RoleId] NVARCHAR (450) NOT NULL, | |
CONSTRAINT [PK_AspNetUserRoles] PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC), | |
CONSTRAINT [FK_AspNetUserRoles_AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE, | |
CONSTRAINT [FK_AspNetUserRoles_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE | |
); | |
GO | |
CREATE NONCLUSTERED INDEX [IX_AspNetUserRoles_RoleId] | |
ON [dbo].[AspNetUserRoles]([RoleId] ASC); | |
This file contains hidden or 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].[AspNetUsers] ( | |
[Id] NVARCHAR (450) NOT NULL, | |
[UserName] NVARCHAR (256) NULL, | |
[NormalizedUserName] NVARCHAR (256) NULL, | |
[Email] NVARCHAR (256) NULL, | |
[NormalizedEmail] NVARCHAR (256) NULL, | |
[EmailConfirmed] BIT NOT NULL, | |
[PasswordHash] NVARCHAR (MAX) NULL, | |
[SecurityStamp] NVARCHAR (MAX) NULL, | |
[ConcurrencyStamp] NVARCHAR (MAX) NULL, | |
[PhoneNumber] NVARCHAR (MAX) NULL, | |
[PhoneNumberConfirmed] BIT NOT NULL, | |
[TwoFactorEnabled] BIT NOT NULL, | |
[LockoutEnd] DATETIMEOFFSET (7) NULL, | |
[LockoutEnabled] BIT NOT NULL, | |
[AccessFailedCount] INT NOT NULL, | |
CONSTRAINT [PK_AspNetUsers] PRIMARY KEY CLUSTERED ([Id] ASC) | |
); | |
GO | |
CREATE NONCLUSTERED INDEX [EmailIndex] | |
ON [dbo].[AspNetUsers]([NormalizedEmail] ASC); | |
GO | |
CREATE UNIQUE NONCLUSTERED INDEX [UserNameIndex] | |
ON [dbo].[AspNetUsers]([NormalizedUserName] ASC) WHERE ([NormalizedUserName] IS NOT NULL); | |
This file contains hidden or 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].[AspNetUserTokens] ( | |
[UserId] NVARCHAR (450) NOT NULL, | |
[LoginProvider] NVARCHAR (450) NOT NULL, | |
[Name] NVARCHAR (450) NOT NULL, | |
[Value] NVARCHAR (MAX) NULL, | |
CONSTRAINT [PK_AspNetUserTokens] PRIMARY KEY CLUSTERED ([UserId] ASC, [LoginProvider] ASC, [Name] ASC), | |
CONSTRAINT [FK_AspNetUserTokens_AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment