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