From be76c3a5f3999fbddff83a3f462a341f2fe52601 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 13 Nov 2021 15:08:33 +0200 Subject: [PATCH] script fix --- .../1.0.1/02.New structure for AppUser table.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IdentityServer.Domain.Data/Scripts/1.0.1/02.New structure for AppUser table.sql b/IdentityServer.Domain.Data/Scripts/1.0.1/02.New structure for AppUser table.sql index a2de3da..911edc4 100644 --- a/IdentityServer.Domain.Data/Scripts/1.0.1/02.New structure for AppUser table.sql +++ b/IdentityServer.Domain.Data/Scripts/1.0.1/02.New structure for AppUser table.sql @@ -14,7 +14,7 @@ begin [Password] varchar(100) not null, FirstName varchar(100), LastName varchar(100), - Email varchar(100) constraint UQ_AppUser_Email unique, + Email varchar(100), ProfilePictureUrl varchar(200), SecurityStamp varchar(200) constraint UQ_AppUser_SecurityStamp unique, StatusId int not null constraint FK_AppUser_UserStatus references UserStatus(StatusId), @@ -26,6 +26,14 @@ begin end go +if not exists (select top 1 1 from sys.indexes where name = 'IDX_AppUser_Email_NOTNULL' AND object_id = OBJECT_ID('AppUser')) +begin + CREATE UNIQUE NONCLUSTERED INDEX IDX_AppUser_Email_NOTNULL + ON AppUser(Email) + WHERE Email IS NOT NULL +end +go + if not exists (select top 1 1 from AppUser) begin declare @activeStatusId int